azure webjobssdk - Get BrokeredMessage from within custom IJobActivator -


is possible @ underlying brokeredmessage in web job service bus trigger within ijobactivator? useful in multi-tenant scenario.

i'm using custom ijobactivator unity instantiate jobs. within unityjobactivator class, i'd able @ underlying brokeredmessage , pull custom properties off of it, such "tenant", of messages have. allow me inject appropriate database connection, or configuration objects job class before executed.

below example want inject itenantconfiguration job, have based on brokeredmessage custom property. if access brokeredmessage within unityjobactivator.

public class customjob {     private const string subscription = "subscription";     private const string topic = "topic";      private itenantconfiguration config;      public customjob(itenantconfiguration config)     {         // configuration depends on tenant property of brokeredmessage         this.config = config;     }      public void handle([servicebustrigger(topic, subscription)] mymessage mymessage)     {         // mymessage , appropriate configuration     }  } 

yes, bind brokeredmessage instead of mymessage:

public void handle([servicebustrigger(topic, subscription)] brokeredmessage mymessage) { ... } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -