Andreas, Looking at the route, it looks like you're trying to archive processed exchanges. You could do this by adding an ExchangeListener to the container, which will then get invoked for every exchange passing through the NMR. You can then keep track of all the exchanges by looking at their correlation id and this will allow you to figure out what the original exchange was and where it came from. The additional benefit is that you can archive the XML message when the last exchange in the entire flow has reached the DONE status, so you're 100% sure that all the exchanges are fully handled before archiving them.
We've implemented something along these lines for a customer, so I'm going to check if they're willing to donate/share some of that code, but if they don't and you would like to investigate this possibility, I'll gladly try to help you out whenever you run into problems. Regards, Gert Vanthienen ------------------------ Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/10/8 atr <[email protected]>: > > Hello. > > I've got a problem with ServiceMix 3.2. and a message routing. Following: > > I receive a message with a file poller: > Point 1: > <file:poller service="sportscheck:OrdersInProduction" > endpoint="endpoint" > targetService="sportscheck:eip" > file="${demandware.export.production.orders}" > recursive="true" > period="${orders.dw.export.210.filepoller}" > filter="#XMLFilter"> > </file:poller> > > This message will be sent to: > Point 2: > <eip:static-recipient-list service="sportscheck:eip" > endpoint="endpoint"> > <eip:recipients> > <eip:exchange-target service="sportscheck:orderBean" /> > <eip:exchange-target service="sportscheck:archiveBean" > /> > </eip:recipients> > </eip:static-recipient-list> > > and then again to: > Point 3: > <bean:endpoint service="sportscheck:orderBean" > endpoint="endpoint" bean="#OrderBean" /> > <bean id="OrderBean" > class="de.mmsdresden.sportscheck.beans.OrderBean" > /> > <bean id="ArchiveBean" > class="de.mmsdresden.sportscheck.beans.ArchiveBean" /> > </beans> > > The java bean receives the message as object of type > javax.jbi.messaging.MessageExchange. > How can I identify the starting point (Point 1) of my message, what is in my > example the file:poller ? > > I need any identifying information, because I use this message routing way > (Point1 - Point2 - Point3) with several <file:pollers> (Point1a - Point1b - > Pointxyz). In my java bean I want be able to know where my message comes > from, which file poller (Point1a - Point1b - Pointxyz) have been used. > > I can I solve shuch a problem? Is there a possibility to provide a variable > in the different file pollers or can is get the name of the service (in my > example "sportscheck:OrdersInProduction")? > > Thank you really for a help! > > Andreas. > -- > View this message in context: > http://www.nabble.com/How-to-identify-message-origin-after-several-routings---tp25801620p25801620.html > Sent from the ServiceMix - User mailing list archive at Nabble.com. > >
