How can I send a message to a Neuron Topic from the Client API, with Custom Properties already populated when it publishes?
The only send methods I find, send either a string, XML, or the ESBMessage.Body (string). None of these methods appear to be setup to allow me to pass in the actual ESBMessage...and specfically header information with custom properties.
Thoughts?
Tags:
I think I found the answer in the DefaultCustomProperties collection for passing in Custom Properties from the API...is there a way to the Neuron Properties?
Say for examlpe I want to pass in on my message the Header.SessionId. I can call
message.Header.Session = "myCustomValue"
However, I cannot find a Send() method capable of sending in the message...only the message Body get sent in...
Session is an internal property Neuron uses....you should not be using it. To set custom properties in the code...just use the SetProperty() off of the esb message object. I think we ship samples of doing this in the Neuron Fundamentals training doc
here's an abstract:
ESBMessage msg = new ESBMessage(TOPIC, "hi mom");
msg.SetProperty("emerson", "po", "98ijk");
publisher.SendMessage(msg);
ugh...i hate asking stupid questions. Did not see the SendMessage() method when looking for different send options.
Thanks for the quick reply
no worries...there's a whole sample project we ship with the training tutorial...shows a bunch of different ways to send messages...how to connect and inspect connection errors...and how to cast things back into their appropriate data types...
http://support.neuronesb.com/downloads/NeuronFundamentals.zip
Dave..
One thing to help you along, look at esb message class within the C# code activity in a business process or a workflow. It's the exact same API you will use in the client code.
Another approach to consider, in order to make your code less complex is to attache a business process to your publisher. In there, assuming the necessary data is available in the message text, you can set and hydrate the properties.
JP
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by