Event Hub: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-what-is-event-hubs
Event Hub和Databricks集成:https://docs.azuredatabricks.net/spark/latest/structured-streaming/streaming-event-hubs.html
看文档总是比较生涩,这里我们通过模拟一个简单的spark streaming job来说明databricks上怎么用eventhub作为数据源来运行spark streaming job。首先我们需要在azure上建一个event hub,获取到它的connection string。有了这个string,我们就可以模拟往这个event上发数据流信息。下面就是一个简单的例子。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
using System.Threading;
namespace ConsoleApplication1
{
class SendMessageToEventHubs
{