Labels

algorithms (22) Design Patterns (20) java (19) linux (14) Snippet (13) service mix (6) soa (4)

javax.jbi.messaging.MessagingException: Out not supported

Scenario: FilePoller = > EIP Pipeline => {transformer is the bean below} => File Sender { target }
the exception was at the bean. Complete Exception is below
javax.jbi.messaging.MessagingException: Out not supported
at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setMessag(MessageExchangeImpl.java:357)
at com.bytes.tutorial.MyBean.onMessageExchange(MyBean.java:46)
at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:230)
at org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:217)
at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchangeSyncLifeCycleWrapper.java:60)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:632)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:185)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)


  public void onMessageExchange(MessageExchange exchange)
throws MessagingException {
System.out.println("Received exchange: " + exchange);
System.out.println("getPattern exchange: " + exchange.getPattern());
System.out.println("getStatus exchange: " + exchange.getStatus());
System.out.println("Role exchange: " + exchange.getRole().toString());
NormalizedMessage in = exchange.getMessage("in");
exchange.setMessage(in, "out");
channel.send(exchange);
}

is changed to have a check

        if (exchange.getStatus() == ExchangeStatus.DONE)
return;
or
  if (exchange.getStatus() == ExchangeStatus.ACTIVE){
System.out.println("Received exchange: " + exchange);
System.out.println("getPattern exchange: " + exchange.getPattern());
System.out.println("getStatus exchange: " + exchange.getStatus());
System.out.println("Role exchange: " + exchange.getRole().toString());
NormalizedMessage in = exchange.getMessage("in");
exchange.setMessage(in, "out");
channel.send(exchange);
}



No comments:

Post a Comment

Search 24 Bytes