I'm seeing some weird behavior with Neuron 3.0 that's driving me nuts. Has anyone else seen this or have any ideas on how to fix it?
Service A is a WCF Service hosted with a Windows service. It only sends messages to the bus via a client connector endpoint.
Service B, C are other WCF Services hosted with different Windows services. They only receive and reply to messages from the bus via a service connector endpoint.
Messages are routed from service A to service B or C via an On Publish process. The process contains only one step - a code block with the following code:
string url = context.Data.GetProperty("MessageHeader","To");
int indexOfLastSlash = url.LastIndexOf("/");
int indexOfSecondToLastSlash = url.LastIndexOf("/", indexOfLastSlash-1);
string target = url.Substring(indexOfSecondToLastSlash+1, indexOfLastSlash-indexOfSecondToLastSlash-1);
switch (target)
{
case "Agent":
case "Client":
context.Data.Header.Topic = "LeadManager.Client";
break;
case "Distribution":
context.Data.Header.Topic = "LeadManager.Distribution";
break;
case "Lead":
context.Data.Header.Topic = "LeadManager.Lead";
break;
}
End-to-end communication between service A and the other services works great. The issue is that the query string parameters are being "processed" somewhere in between.
EXAMPLE:
If I hit Service A with the following URL, Service B sends back a list of the parameters it received:
URL: http://localhost:8100/ServiceA/Distribution/Action?clientId=12&programId=21&agentId=22&leadId=31
Text: leadId# agentId# clientId#12programId=21agentId=22leadId=31 programId#
Here is what the text should look like:
Text: leadId#31 agentId#22 clientId#12 programId#21
Basically, the '&' are being stripped from the query string as the message passes through the ESB from one service to another.
Things I've checked:
Case AA: Hitting Service B directly shows correct values
Text: leadId#1 agentId#10 clientId#533 programId#19
Case BB: Hitting the client connector URL directly to send to Service B (skipping Service A) shows incorrect values
Text: leadId# agentId# clientId#12programId=21agentId=22leadId=31 programId#
Case CC: Setting a breakpoint within Service A and hitting Service A shows that it is correctly mapping the query string parameters.
We migrated from Neuron 2.6 to Neuron 3.0 last week so my I'm guessing that's the culprit.
Any ideas or solutions would be greatly appreciated!
Tags:
Stephen,
In Neuron 3.0 we have a new HTTP API that you can use to access all the query string parameters from a code step. You can find it at context.Data.Http. Look at the new REST samples that ship with 3.0 for examples of utilizing that API.
Joe
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by