You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Marcos Díez Fernández <md...@tecsisa.com> on 2011/06/02 19:14:43 UTC

How to get info about a route node from the NMR exchange?

Hi all, I'll try to explain the best I can:

I have a route that looks like this:

from("nmr:endpoint1")
   ...
      .to("nmr:endpoint2");

So the 'flow' of the exchange could be something like:

[Bundle1] ----> [BundleWithCamelRoute] ----> [Bundle2]

What I'm trying is to track the exchange status at every step between bundle1 and bundle2.

I have a TracerBundle that listens to the NMR to get the NMR Exchanges. Also, the BundleWithCamelRoute uses the Tracer Interceptor to send to the TracerBundle (through an NMR endpoint) the TraceEventMessages containing the Camel Exchanges between every route node.

So the TracerBundle receives NMR Exchanges and Camel Exchanges and persist some info to a database. The important thing is that every step should 'know' which other step is its previous one, to have something like:

[NMRExchangeFromBundle1] <---- [CamelStep1] <---- ....  <---- [CamelStepN] <---- [NMRExchangeToBundle2]

When persisting info from a Camel Exchange, I can know all about its NMRExchange predecessor since the TraceEventMessage contains it in the tracedExchange's properties:

defaultTraceEventMessage.getTracedExchange().getProperties().get("nmrExchange");

The problem comes when the camel route reaches the to("nmr:endpoint2") node and produces an NMR exchange.
I would need to know from the NMR exchange which camel node produced it. Apparently the NMR exchange doesn't save info from the node which produced it, so is this possible in any way?

Summarizing: If a route node sends a message to an nmr endpoint, can I get any info about that node from the NMR exchange?

Hope my explanation isn't too confusing...

Thanks in advance,
BR,
Marcos.


RE: How to get info about a route node from the NMR exchange?

Posted by Marcos Díez Fernández <md...@tecsisa.com>.
Any idea? Is it even possible? 

Thanks,
Marcos.

-----Mensaje original-----
De: Marcos Díez Fernández [mailto:mdiez@tecsisa.com] 
Enviado el: jueves, 02 de junio de 2011 19:15
Para: users@camel.apache.org
Asunto: How to get info about a route node from the NMR exchange?

Hi all, I'll try to explain the best I can:

I have a route that looks like this:

from("nmr:endpoint1")
   ...
      .to("nmr:endpoint2");

So the 'flow' of the exchange could be something like:

[Bundle1] ----> [BundleWithCamelRoute] ----> [Bundle2]

What I'm trying is to track the exchange status at every step between bundle1 and bundle2.

I have a TracerBundle that listens to the NMR to get the NMR Exchanges. Also, the BundleWithCamelRoute uses the Tracer Interceptor to send to the TracerBundle (through an NMR endpoint) the TraceEventMessages containing the Camel Exchanges between every route node.

So the TracerBundle receives NMR Exchanges and Camel Exchanges and persist some info to a database. The important thing is that every step should 'know' which other step is its previous one, to have something like:

[NMRExchangeFromBundle1] <---- [CamelStep1] <---- ....  <---- [CamelStepN] <---- [NMRExchangeToBundle2]

When persisting info from a Camel Exchange, I can know all about its NMRExchange predecessor since the TraceEventMessage contains it in the tracedExchange's properties:

defaultTraceEventMessage.getTracedExchange().getProperties().get("nmrExchange");

The problem comes when the camel route reaches the to("nmr:endpoint2") node and produces an NMR exchange.
I would need to know from the NMR exchange which camel node produced it. Apparently the NMR exchange doesn't save info from the node which produced it, so is this possible in any way?

Summarizing: If a route node sends a message to an nmr endpoint, can I get any info about that node from the NMR exchange?

Hope my explanation isn't too confusing...

Thanks in advance,
BR,
Marcos.