Hi all,
I am getting the Exception "Exchange not found" from the
ConsumerProcessor when I am sending (using separate threads) two new JBI
messages to the same SU nearly simultaneously. When I send the same
message (but only once) it does not cause any problems.
After the Exception ServiceMix locks up completely.
I use the following code (and reuse the existing delivery channel) in an
implementation of MessageExchangeListener:
public InOut sendMessageExchange(QName service, Source content,
Map<String, Object> properties, boolean sendSync)
throws MessagingException
{
logger.debug("Preparing to send message to service " +
service.getLocalPart());
InOut exchange =
channel.createExchangeFactory().createInOutExchange();
NormalizedMessage message = exchange.createMessage();
message.setContent(content);
if(properties != null && properties.size() > 0)
{
logger.debug("Adding " + properties.size() + " properties to
message");
Set<Entry<String, Object>> propertiesSet =
properties.entrySet();
for(Entry<String, Object> propertyEntry: propertiesSet)
{
message.setProperty(propertyEntry.getKey(),
propertyEntry.getValue());
}
}
exchange.setMessage(message, "in");
exchange.setService(service);
if (sendSync)
{
logger.debug("Sending message synchronous");
channel.sendSync(exchange);
}
else
{
logger.debug("Sending message asynchronous");
channel.send(exchange);
}
return exchange;
}
This code is executed in a separate function.
Exception:
WARN - jetty - /stt/
java.lang.IllegalStateException: Exchange not found
at
org.apache.servicemix.http.processors.ConsumerProcessor.process(Consumer
Processor.java:192)
at
org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.ja
va:71)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler
Collection.java:211)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav
a:114)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:375)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
396)
at
org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(Selec
tChannelConnector.java:511)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.ja
va:442)
I see bug reports reporting something similar (SM-1179, SM-1294), but
there is not enough information in these reports to confirm this problem
for me. Does anybody else have the same problem? How do other people
send JBI messages from an SU?
Thanks,
Jeroen Ninck Blok
Consultant
_________________________________________
Logica - Releasing your potential
Kralingseweg 241 - 249
3062 CE Rotterdam
PO Box 8566
3009 AN Rotterdam
The Netherlands
T: +31 10 253 7343
E: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
www.logica.com <http://www.logica.com>
-
Logica Nederland BV
Registered office in Amstelveen, The Netherlands
Registration Number Chamber of Commerce: 33136004
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an intended
recipient then please promptly delete this e-mail and any attachment and all
copies and inform the sender. Thank you.