I have an issue with sending messages to a Client Connector from a C# test app. The main issue is that i never receive a response from Neuron and the Connection Times out. I'm using the sample code from the Scatter-Gather Pattern sample included in the documentation
If anybody has any hints on what i'm missing, it would be appreciated.
static class Utility
{
const string _propName = "NeuronServiceList";
const string _ns = "urn:xmlns:neuronesb-com:soapheaders";
const string _msg = @"
<Notification>
<Id>1234567890</Id>
<sObject xsi:type=""sf:Account"" xmlns:sf=""urn:sobject.enterprise.soap.sforce.com"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">
<sf:Id>001Z0000002lOr4IAE</sf:Id>
<sf:BillingCity>New York</sf:BillingCity>
<sf:BillingCountry>United States</sf:BillingCountry>
</sObject>
</Notification>";
const string _neuronServiceList =
@"<services>
<service topic='SalesforceEvents.CreateAccount'
action='http://schema.neuron.sample/CreateAccount'>
</service>
</services>";
public static void PipelineByWebService()
{
XmlReader xmlReader = null;
Message reqMsg = null;
// Sending a request/response to a client connector
using (var chan = new ChannelFactory<IRequestChannel>(new BasicHttpBinding() , new EndpointAddress("http://localhost:55555/test")))
{
var proxy = chan.CreateChannel();
using (xmlReader = XmlReader.Create(new System.IO.MemoryStream( System.Text.Encoding.UTF8.GetBytes(_msg))))
{
using (reqMsg = Message.CreateMessage(chan.Endpoint.Binding.MessageVersion, "", xmlReader))
{
// add custom headers to define services for scatter gather pattern
MessageHeader header = MessageHeader.CreateHeader(_propName, _ns, _neuronServiceList);
reqMsg.Headers.Add(header);
Console.WriteLine(proxy.Request(reqMsg).ToString());
reqMsg.Close();
}
xmlReader.Close();
}
proxy.Close();
chan.Close();
}
}
}
Hi John,
Have you checked the event log for the reported errors?
Hi Marty,
I had a look in the Neuron ESB event log and Neuron_EventLogFailedWrites.txt and found the errors below. They tell me i got a timeout which is strange as this is internal to Neuron. So in effect 2 timeouts are occurring - one on my client caused by the timeout on Neuron.
I still don't know how to fix it though.
John
Event Log
Event Info: Client connector failed to process a received message due to an exception
Type: Client Connector
Name: SalesforceServicePublications
MessageId: f98deab6-40bc-4a42-bceb-c85c7237ed7c
MessageTopic: SalesforceEvents
MessageSourceId:
Exception: Request timeout
Method: ProcessMessage2Internal
Stack: at Neuron.Esb.EsbService.ESBClientConnector.ProcessMessage2Internal(Message message)
And also this
Event Info: A message has been saved to the audit failed database. Topic: SalesforceEvents, Party: , Id: f98deab6-40bc-4a42-bceb-c85c7237ed7c
FailureDetail - Exception Type: System.ServiceModel.FaultException
Exception Message: Request timeout
Exception Trace: at Neuron.Esb.EsbService.ESBClientConnector.ProcessMessage2Internal(Message message)
FailureType - FaultException
Exception:
Method:
Stack:
In the Neuron_EventLogFailedWrites.txt i found this
Method: SendMessage
Entry at 14/02/2012 16:06:57
Could not write message to the Neuron Esb event log. Reason: The source 'Neuron ESB Client Context' is not registered in log 'Neuron ESB'. (It is registered in log 'Application'.) " The Source and Log properties must be matched, or you may set Log to the empty string, and it will automatically be matched to the Source property.
Original message to be written to the event log. Message: Event Info: Exception Type: System.TimeoutException
Exception Message: Timeout occured while waiting for a reply to message d16cd839-cae2-48dc-b394-425ac8b20f28. Party - SalesforceService.Publisher. Topic - SalesforceEvents.AccountCreated
Exception Trace: at Neuron.Esb.Channels.RequestResponseCorrelationDataItem.Wait()
at Neuron.Esb.Party.SendMessage(ESBMessage message, Boolean duplicateMessage)
at Neuron.Esb.EsbService.ESBClientConnector.ProcessMessage2Internal(Message message)
Exception:
Method:
Stack:
Entry at 14/02/2012 16:06:57
Could not write message to the Neuron Esb event log. Reason: The source 'Neuron ESB Client Context' is not registered in log 'Neuron ESB'. (It is registered in log 'Application'.) " The Source and Log properties must be matched, or you may set Log to the empty string, and it will automatically be matched to the Source property.
Original message to be written to the event log. Message: Event Info: Exception Type: System.ServiceModel.FaultException
Exception Message: Request timeout
Exception Trace: at Neuron.Esb.EsbService.ESBClientConnector.ProcessMessage2Internal(Message message)
Exception:
Method:
Stack:
I came up with a work-around for this, but i'm sure there must be a better way. I had to introduce a new topic that used a pipleline to republish to my original topic and then called a cancel step. This had the result of issuing the response to the client and allowing the process to continue.
The down side of this is that i have to create and extra "proxy" topic and it's associated pub/subs that can also publish to the destination topic for each Client Connector.
I anybody finds a more suitable implementation, I'd love to hear about it.
Hi John,
How is your client connector configured. Its has to match the configuration in the client code.
Kind regards,
Marty
Here are my Client Connector settings. As far as i can tell they match the code in my first post
General:
- Binding: BasicHttp
Binding
- Message Pattern : Request Reply
Max Message Size: 1000000
Transactions : None
Client Connector:
- Enabled : true
- Capture Custom Headers: false
URL: http://localhost:9001
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by