Neuron ESB User Network

The Service Bus for the Connected Business

Hi

In my publisher i want to set the Topic of the message based on the root note in an XML document.

I have tryied with this code, context.Data.Header.Topic ="Test", but does not work.

The topic "Test", is created under topics.

Is this propertie read-only?

Can it be changed from a process?

Views: 482

Reply to This

Replies to This Discussion

Christian - are you using a publish step from within a process?  If you are, the publish step ignores the property context.Data.Header.Topic.  You set the topic that the publish step uses in one of two ways.  Select the publish step and you'll see the properties for it in the lower-right corner of ESB Explorer.  If the "Selector Type" property is set to "Constant", then expand the "Topic Selector" property and select the Topic from the drop-down list.  If the "Selector Type" property is sent to Code, then click on the ellipsis next to the Code property to open a code editor.  You need to return a string that is the topic to publish to.  In your case, you can either use:

return "Test";

Or, if you have already set the topic in a Code step:

return message.Header.Topic;

If you are not using a publish step in the process, then something else is happening.  Can you check the Neuron ESB v3 event log and see if there are any errors or warnings?

Thank you,

Joe

Yes I'm using a process step. Have attached an screen shot.

I have then added the process under my publisher.

I'm not sure where you are in the system, of you description.

Can you please make a screenshot of where I find those settings you descripe?

Found the place :-)

Will it execute all c# code in that field, or any limitations?

No - Neuron doesn't execute C# code in any property value fields.  The only places C# code is executed are properties that open code editors. 

There are a couple of different things to point out here:

1.  All publish mode adapter endpoints need to have a valid "Publish Topic" value set.  This is the topic the message will be published to the bus, unless #2 below applies.

2.  The topic of a message can be changed inside a Process.  There are two ways to do this.  The first way is in a code step (i.e. C# Step), where you set context.Data.Header.Topic = "yourNewTopic".  This will override whatever value you put into the Publish Topic property in the adapter endpoint.  The second way is to use a Publish Step (different than what you show above).

I attached a Neuron configuration that changes the topic in a process using a code step.  One thing to note is that if you have a process, the publisher needs to be configured to execute the process.

Attachments:

The Publish step is different than the C# Step you have in your process:

RSS

Neuron ESB Product Support Forums and Communities

Latest Activity

Anupama Nair posted a discussion

Marketo Adapter Invalid Token

Hi,We are using the Marketo adapter to push account updates to Marketo. It works well for some time then starts failing with Invalid Token unless restarted. Is there a configuration that can be done so it can auto refresh the token when required?Thanks!See More
Nov 6, 2023
Sayantini Basak posted a discussion

Maximum payload size(REST API) for requests interfacing to NeuronESB

I am new to Neuron ESB and in our current scenario,We need to process batch transactions comprising of ~1000 records and send them to Neuron ESB for further processing. I would like to understand what is the maximum size of payload that can be transferred using REST interface to Neuron ESB.See More
Jul 22, 2022
Profile IconRobert E Dunie and Sayantini Basak joined Neuron ESB User Network
Apr 28, 2022
Profile IconDayanand, Frederic C, Steffen Greve-Oksfeldt and 1 more joined Neuron ESB User Network
Mar 16, 2022
Profile IconCam Vong and Mitja Luznar joined Neuron ESB User Network
Jan 27, 2022
Profile IconWill Hitzges, Chad Parsons, michael larsen and 4 more joined Neuron ESB User Network
Jun 11, 2021
Anupama Nair posted a discussion

ODBC stored proc polling with temporary tables

We have set up an ODBC adapter to poll a stored proc.We found that if the stored proc has a temporary table defined the rows returned are always 0.Any idea why this would be and what we can do to get around it?See More
Dec 14, 2020
Prasanth Kharade is now a member of Neuron ESB User Network
Dec 30, 2019

Badge

Loading…

© 2024   Created by Neuron Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service