azure webjobssdk - Any Example of WebJob using EventHub? -
i've tried come example in webjobssdk github
var eventhubconfig = new eventhubconfiguration(); string eventhubname = "myhubname"; eventhubconfig.addsender(eventhubname,"endpoint=sb://test.servicebus.windows.net/;sharedaccesskeyname=sendrule;sharedaccesskey=xxxxxxxx"); eventhubconfig.addreceiver(eventhubname, "endpoint=sb://test.servicebus.windows.net/;sharedaccesskeyname=receiverule;sharedaccesskey=yyyyyyy"); config.useeventhub(eventhubconfig); jobhost host = new jobhost(config);
but i'm afraid that's not far enough of limited "skillset"!
i can find no instance of jobhostconfiguration has useeventhub property (using v1.2.0-alpha-10291 version of microsoft.azurewebjobs package), can't pass eventhubconfiguration jobhost.
i've used eventhub before, not within webjob context. don't see if eventhostprocessor still required if using webjob triggering...or webjob trigger act eventhostprocessor?
anyway, if has more complete example simpleton me sweet! thanks
from documentation here, should have information need.
what missing reference of microsoft.azure.webjobs.servicebus.1.2.0-alpha-10291
nuget package.
the useeventhub
extension method declared in package.
otherwise configuration seems ok. here example on how receive or send messages from/to eventhub:
public class basictest { public class payload { public int counter { get; set; } } public static void sendevents([eventhub("myhubname")] out payload x) { x = new payload { counter = 100 }; } public static void trigger( [eventhubtrigger("myhubname")] payload x, [eventhub("myhubname")] out payload y) { x.counter++; y = x; } }
Comments
Post a Comment