You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by netflexity <mf...@netflexity.com> on 2007/04/05 19:44:04 UTC

State management between components (nodes) of a flow

I need to preserve original request message and use it in case some business
rule matches. Right now, I've manageed to do this with Singleton and
getContext().getNamingContext().bind(), but I consider both of these
solutions pretty ugly. Being a Message Broker developer, I am used to
Environment, which allows to preserve state for the duration of flow
execution.

I tried setting properties on MessageExchange, but that only works from one
node to another, not node1 to node 10.

Any suggestions?

Thank you.
-Max
-- 
View this message in context: http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9859826
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: State management between components (nodes) of a flow

Posted by netflexity <mf...@netflexity.com>.
Decided to post a solution to this based on suggestions. I created a cache,
for testing purposes in a form of a Map. Created 3 LW Components:
StoreMessage, RetrieveMessage and ClearMessage. They use CORRELATION_ID,
which is a unique ID that correlates all the components of a flow, to save
and get the message from a cache.

Here is a small snippet from RetrieveMessage:

/* (non-Javadoc)
	 * @see
org.apache.servicemix.components.util.TransformComponentSupport#transform(javax.jbi.messaging.MessageExchange,
javax.jbi.messaging.NormalizedMessage,
javax.jbi.messaging.NormalizedMessage)
	 */
	@Override
	protected boolean transform(MessageExchange exchange, NormalizedMessage in,
NormalizedMessage out) throws Exception {
		String operationName = exchange.getOperation().getLocalPart();
		if (operationName == null) {
			throw new JBIException("Operations name was NOT set in
MessageExchange!");
		}
		String exchangeId = exchange.getExchangeId();
		String correlationId =
(String)exchange.getProperty(JbiConstants.CORRELATION_ID);
		String key = exchangeId;
		if(StringUtils.isNotBlank(correlationId)){
			key = correlationId;
		}
		logger.debug("Retrieving message with key:" + (key + "_" +
operationName));
		String content = (String)cache.get(key + "_" + operationName);
		if(content != null){
			logger.debug("RetrieveMessageComponent: Source is not null");
			out.setContent(new StringSource(content));
		}
		else{
			logger.debug("RetrieveMessageComponent: Source is null");
			out.setContent(in.getContent());
		}
		return true;
	}
-- 
View this message in context: http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tp9859826p17496818.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: State management between components (nodes) of a flow

Posted by netflexity <mf...@netflexity.com>.
Actually, my custom-se has a catch terminal, or in the words of servicemix,
target-exchange. I just want a way to have a Flow session or context. Still
cannot believe that JBI spec does not have that....


gnodet wrote:
> 
> An exchange is only used between two components, so in your flow
> there will be several exchanges.  This also means that if you want
> to resend the exchange somehow, usually you will have to create
> a new exchange based on the original one (thought there is a
> feature in servicemix that you could use to resend the *same*
> exchange...)
> So if I understand, what you need is a component wich would
> handle error handling where one could configure an error policy.
> That could be a simple redelivery, re-route to another component,
> etc ...  Then this may be related to
> http://issues.apache.org/activemq/browse/SM-910
> and http://issues.apache.org/activemq/browse/SM-716.
> 
> On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>>
>>
>> Here is my flow
>>
>> http->wt->cbrouter->srslip->xslt->custome-se->xslt
>> If custom-se fails, I need to rerun original message.
>> If I store the message after http under exchange id, will the exchange id
>> be
>> the same at the last node.
>>
>> BTW, is exchange the same for entire flow, or just node-to-node. Because
>> saving the message in exchange properties does not preserve it.
>>
>> Thanks.
>>
>>
>> gnodet wrote:
>> >
>> > Why don't you use the exchange id to store / retrieve it ?
>> >
>> > On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>> >>
>> >>
>> >> The problem is that I need to store the original request message in
>> some
>> >> FlowContext, but JBI spec has nothing like that. So, I created a
>> >> singleton
>> >> that preserves the message, but in a multi-threaded environment this
>> >> would
>> >> not work, cause I need some unique identifier(same per flow execution)
>> >> that
>> >> I could use to lookup the value.
>> >>
>> >> It is ugly, but that is the only way I found to preserve state in the
>> >> flow....
>> >>
>> >> Thank you.
>> >>
>> >>
>> >> gnodet wrote:
>> >> >
>> >> > There is a correlationId which is set and propagated by most
>> >> components.
>> >> > All related exchanges should have the same correlationId.
>> >> > Is that what you are looking for ? I'm not sure to understand your
>> >> problem
>> >> > ...
>> >> >
>> >> > On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>> >> >>
>> >> >>
>> >> >> Thanks for the suggestion, but for me it is a question of where to
>> >> >> preserve
>> >> >> the message, not how. I wish there would be a unique identifier for
>> >> each
>> >> >> execution of the flow.
>> >> >>
>> >> >> Thank you.
>> >> >>
>> >> >>
>> >> >>
>> >> >> bsnyder wrote:
>> >> >> >
>> >> >> > On 4/5/07, netflexity <mf...@netflexity.com> wrote:
>> >> >> >>
>> >> >> >> I need to preserve original request message and use it in case
>> some
>> >> >> >> business
>> >> >> >> rule matches. Right now, I've manageed to do this with Singleton
>> >> and
>> >> >> >> getContext().getNamingContext().bind(), but I consider both of
>> >> these
>> >> >> >> solutions pretty ugly. Being a Message Broker developer, I am
>> used
>> >> to
>> >> >> >> Environment, which allows to preserve state for the duration of
>> >> flow
>> >> >> >> execution.
>> >> >> >>
>> >> >> >> I tried setting properties on MessageExchange, but that only
>> works
>> >> >> from
>> >> >> >> one
>> >> >> >> node to another, not node1 to node 10.
>> >> >> >
>> >> >> > Have you considered configuring the Wire Tap pattern via the
>> >> >> > servicemix-eip component?
>> >> >> >
>> >> >> >
>> >> >>
>> >>
>> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap
>> >> >> >
>> >> >> > This pattern in the EIP component allows you to grab a copy of an
>> >> >> > input message and send it wherever you want. If this were the
>> first
>> >> >> > component in your flow, you could send a copy of the request
>> >> message.
>> >> >> >
>> >> >> > Bruce
>> >> >> > --
>> >> >> > perl -e 'print
>> >> >> >
>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> >> >> > );'
>> >> >> >
>> >> >> > Apache Geronimo - http://geronimo.apache.org/
>> >> >> > Apache ActiveMQ - http://activemq.org/
>> >> >> > Apache ServiceMix - http://servicemix.org/
>> >> >> > Castor - http://castor.org/
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9871768
>> >> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > Cheers,
>> >> > Guillaume Nodet
>> >> > ------------------------
>> >> > Architect, LogicBlaze (http://www.logicblaze.com/)
>> >> > Blog: http://gnodet.blogspot.com/
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872138
>> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > Cheers,
>> > Guillaume Nodet
>> > ------------------------
>> > Architect, LogicBlaze (http://www.logicblaze.com/)
>> > Blog: http://gnodet.blogspot.com/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872511
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872899
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: State management between components (nodes) of a flow

Posted by Guillaume Nodet <gn...@gmail.com>.
An exchange is only used between two components, so in your flow
there will be several exchanges.  This also means that if you want
to resend the exchange somehow, usually you will have to create
a new exchange based on the original one (thought there is a
feature in servicemix that you could use to resend the *same*
exchange...)
So if I understand, what you need is a component wich would
handle error handling where one could configure an error policy.
That could be a simple redelivery, re-route to another component,
etc ...  Then this may be related to
http://issues.apache.org/activemq/browse/SM-910
and http://issues.apache.org/activemq/browse/SM-716.

On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>
>
> Here is my flow
>
> http->wt->cbrouter->srslip->xslt->custome-se->xslt
> If custom-se fails, I need to rerun original message.
> If I store the message after http under exchange id, will the exchange id
> be
> the same at the last node.
>
> BTW, is exchange the same for entire flow, or just node-to-node. Because
> saving the message in exchange properties does not preserve it.
>
> Thanks.
>
>
> gnodet wrote:
> >
> > Why don't you use the exchange id to store / retrieve it ?
> >
> > On 4/6/07, netflexity <mf...@netflexity.com> wrote:
> >>
> >>
> >> The problem is that I need to store the original request message in
> some
> >> FlowContext, but JBI spec has nothing like that. So, I created a
> >> singleton
> >> that preserves the message, but in a multi-threaded environment this
> >> would
> >> not work, cause I need some unique identifier(same per flow execution)
> >> that
> >> I could use to lookup the value.
> >>
> >> It is ugly, but that is the only way I found to preserve state in the
> >> flow....
> >>
> >> Thank you.
> >>
> >>
> >> gnodet wrote:
> >> >
> >> > There is a correlationId which is set and propagated by most
> >> components.
> >> > All related exchanges should have the same correlationId.
> >> > Is that what you are looking for ? I'm not sure to understand your
> >> problem
> >> > ...
> >> >
> >> > On 4/6/07, netflexity <mf...@netflexity.com> wrote:
> >> >>
> >> >>
> >> >> Thanks for the suggestion, but for me it is a question of where to
> >> >> preserve
> >> >> the message, not how. I wish there would be a unique identifier for
> >> each
> >> >> execution of the flow.
> >> >>
> >> >> Thank you.
> >> >>
> >> >>
> >> >>
> >> >> bsnyder wrote:
> >> >> >
> >> >> > On 4/5/07, netflexity <mf...@netflexity.com> wrote:
> >> >> >>
> >> >> >> I need to preserve original request message and use it in case
> some
> >> >> >> business
> >> >> >> rule matches. Right now, I've manageed to do this with Singleton
> >> and
> >> >> >> getContext().getNamingContext().bind(), but I consider both of
> >> these
> >> >> >> solutions pretty ugly. Being a Message Broker developer, I am
> used
> >> to
> >> >> >> Environment, which allows to preserve state for the duration of
> >> flow
> >> >> >> execution.
> >> >> >>
> >> >> >> I tried setting properties on MessageExchange, but that only
> works
> >> >> from
> >> >> >> one
> >> >> >> node to another, not node1 to node 10.
> >> >> >
> >> >> > Have you considered configuring the Wire Tap pattern via the
> >> >> > servicemix-eip component?
> >> >> >
> >> >> >
> >> >>
> >>
> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap
> >> >> >
> >> >> > This pattern in the EIP component allows you to grab a copy of an
> >> >> > input message and send it wherever you want. If this were the
> first
> >> >> > component in your flow, you could send a copy of the request
> >> message.
> >> >> >
> >> >> > Bruce
> >> >> > --
> >> >> > perl -e 'print
> >> >> >
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> >> >> > );'
> >> >> >
> >> >> > Apache Geronimo - http://geronimo.apache.org/
> >> >> > Apache ActiveMQ - http://activemq.org/
> >> >> > Apache ServiceMix - http://servicemix.org/
> >> >> > Castor - http://castor.org/
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9871768
> >> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Cheers,
> >> > Guillaume Nodet
> >> > ------------------------
> >> > Architect, LogicBlaze (http://www.logicblaze.com/)
> >> > Blog: http://gnodet.blogspot.com/
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872138
> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Architect, LogicBlaze (http://www.logicblaze.com/)
> > Blog: http://gnodet.blogspot.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872511
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: State management between components (nodes) of a flow

Posted by netflexity <mf...@netflexity.com>.
Here is my flow

http->wt->cbrouter->srslip->xslt->custome-se->xslt
If custom-se fails, I need to rerun original message.
If I store the message after http under exchange id, will the exchange id be
the same at the last node.

BTW, is exchange the same for entire flow, or just node-to-node. Because
saving the message in exchange properties does not preserve it. 

Thanks.


gnodet wrote:
> 
> Why don't you use the exchange id to store / retrieve it ?
> 
> On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>>
>>
>> The problem is that I need to store the original request message in some
>> FlowContext, but JBI spec has nothing like that. So, I created a
>> singleton
>> that preserves the message, but in a multi-threaded environment this
>> would
>> not work, cause I need some unique identifier(same per flow execution)
>> that
>> I could use to lookup the value.
>>
>> It is ugly, but that is the only way I found to preserve state in the
>> flow....
>>
>> Thank you.
>>
>>
>> gnodet wrote:
>> >
>> > There is a correlationId which is set and propagated by most
>> components.
>> > All related exchanges should have the same correlationId.
>> > Is that what you are looking for ? I'm not sure to understand your
>> problem
>> > ...
>> >
>> > On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>> >>
>> >>
>> >> Thanks for the suggestion, but for me it is a question of where to
>> >> preserve
>> >> the message, not how. I wish there would be a unique identifier for
>> each
>> >> execution of the flow.
>> >>
>> >> Thank you.
>> >>
>> >>
>> >>
>> >> bsnyder wrote:
>> >> >
>> >> > On 4/5/07, netflexity <mf...@netflexity.com> wrote:
>> >> >>
>> >> >> I need to preserve original request message and use it in case some
>> >> >> business
>> >> >> rule matches. Right now, I've manageed to do this with Singleton
>> and
>> >> >> getContext().getNamingContext().bind(), but I consider both of
>> these
>> >> >> solutions pretty ugly. Being a Message Broker developer, I am used
>> to
>> >> >> Environment, which allows to preserve state for the duration of
>> flow
>> >> >> execution.
>> >> >>
>> >> >> I tried setting properties on MessageExchange, but that only works
>> >> from
>> >> >> one
>> >> >> node to another, not node1 to node 10.
>> >> >
>> >> > Have you considered configuring the Wire Tap pattern via the
>> >> > servicemix-eip component?
>> >> >
>> >> >
>> >>
>> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap
>> >> >
>> >> > This pattern in the EIP component allows you to grab a copy of an
>> >> > input message and send it wherever you want. If this were the first
>> >> > component in your flow, you could send a copy of the request
>> message.
>> >> >
>> >> > Bruce
>> >> > --
>> >> > perl -e 'print
>> >> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> >> > );'
>> >> >
>> >> > Apache Geronimo - http://geronimo.apache.org/
>> >> > Apache ActiveMQ - http://activemq.org/
>> >> > Apache ServiceMix - http://servicemix.org/
>> >> > Castor - http://castor.org/
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9871768
>> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > Cheers,
>> > Guillaume Nodet
>> > ------------------------
>> > Architect, LogicBlaze (http://www.logicblaze.com/)
>> > Blog: http://gnodet.blogspot.com/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872138
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872511
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: State management between components (nodes) of a flow

Posted by Guillaume Nodet <gn...@gmail.com>.
Why don't you use the exchange id to store / retrieve it ?

On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>
>
> The problem is that I need to store the original request message in some
> FlowContext, but JBI spec has nothing like that. So, I created a singleton
> that preserves the message, but in a multi-threaded environment this would
> not work, cause I need some unique identifier(same per flow execution)
> that
> I could use to lookup the value.
>
> It is ugly, but that is the only way I found to preserve state in the
> flow....
>
> Thank you.
>
>
> gnodet wrote:
> >
> > There is a correlationId which is set and propagated by most components.
> > All related exchanges should have the same correlationId.
> > Is that what you are looking for ? I'm not sure to understand your
> problem
> > ...
> >
> > On 4/6/07, netflexity <mf...@netflexity.com> wrote:
> >>
> >>
> >> Thanks for the suggestion, but for me it is a question of where to
> >> preserve
> >> the message, not how. I wish there would be a unique identifier for
> each
> >> execution of the flow.
> >>
> >> Thank you.
> >>
> >>
> >>
> >> bsnyder wrote:
> >> >
> >> > On 4/5/07, netflexity <mf...@netflexity.com> wrote:
> >> >>
> >> >> I need to preserve original request message and use it in case some
> >> >> business
> >> >> rule matches. Right now, I've manageed to do this with Singleton and
> >> >> getContext().getNamingContext().bind(), but I consider both of these
> >> >> solutions pretty ugly. Being a Message Broker developer, I am used
> to
> >> >> Environment, which allows to preserve state for the duration of flow
> >> >> execution.
> >> >>
> >> >> I tried setting properties on MessageExchange, but that only works
> >> from
> >> >> one
> >> >> node to another, not node1 to node 10.
> >> >
> >> > Have you considered configuring the Wire Tap pattern via the
> >> > servicemix-eip component?
> >> >
> >> >
> >>
> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap
> >> >
> >> > This pattern in the EIP component allows you to grab a copy of an
> >> > input message and send it wherever you want. If this were the first
> >> > component in your flow, you could send a copy of the request message.
> >> >
> >> > Bruce
> >> > --
> >> > perl -e 'print
> >> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> >> > );'
> >> >
> >> > Apache Geronimo - http://geronimo.apache.org/
> >> > Apache ActiveMQ - http://activemq.org/
> >> > Apache ServiceMix - http://servicemix.org/
> >> > Castor - http://castor.org/
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9871768
> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Architect, LogicBlaze (http://www.logicblaze.com/)
> > Blog: http://gnodet.blogspot.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872138
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: State management between components (nodes) of a flow

Posted by netflexity <mf...@netflexity.com>.
The problem is that I need to store the original request message in some
FlowContext, but JBI spec has nothing like that. So, I created a singleton
that preserves the message, but in a multi-threaded environment this would
not work, cause I need some unique identifier(same per flow execution) that
I could use to lookup the value.

It is ugly, but that is the only way I found to preserve state in the
flow....

Thank you.


gnodet wrote:
> 
> There is a correlationId which is set and propagated by most components.
> All related exchanges should have the same correlationId.
> Is that what you are looking for ? I'm not sure to understand your problem
> ...
> 
> On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>>
>>
>> Thanks for the suggestion, but for me it is a question of where to
>> preserve
>> the message, not how. I wish there would be a unique identifier for each
>> execution of the flow.
>>
>> Thank you.
>>
>>
>>
>> bsnyder wrote:
>> >
>> > On 4/5/07, netflexity <mf...@netflexity.com> wrote:
>> >>
>> >> I need to preserve original request message and use it in case some
>> >> business
>> >> rule matches. Right now, I've manageed to do this with Singleton and
>> >> getContext().getNamingContext().bind(), but I consider both of these
>> >> solutions pretty ugly. Being a Message Broker developer, I am used to
>> >> Environment, which allows to preserve state for the duration of flow
>> >> execution.
>> >>
>> >> I tried setting properties on MessageExchange, but that only works
>> from
>> >> one
>> >> node to another, not node1 to node 10.
>> >
>> > Have you considered configuring the Wire Tap pattern via the
>> > servicemix-eip component?
>> >
>> >
>> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap
>> >
>> > This pattern in the EIP component allows you to grab a copy of an
>> > input message and send it wherever you want. If this were the first
>> > component in your flow, you could send a copy of the request message.
>> >
>> > Bruce
>> > --
>> > perl -e 'print
>> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> > );'
>> >
>> > Apache Geronimo - http://geronimo.apache.org/
>> > Apache ActiveMQ - http://activemq.org/
>> > Apache ServiceMix - http://servicemix.org/
>> > Castor - http://castor.org/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9871768
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9872138
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: State management between components (nodes) of a flow

Posted by Guillaume Nodet <gn...@gmail.com>.
There is a correlationId which is set and propagated by most components.
All related exchanges should have the same correlationId.
Is that what you are looking for ? I'm not sure to understand your problem
...

On 4/6/07, netflexity <mf...@netflexity.com> wrote:
>
>
> Thanks for the suggestion, but for me it is a question of where to
> preserve
> the message, not how. I wish there would be a unique identifier for each
> execution of the flow.
>
> Thank you.
>
>
>
> bsnyder wrote:
> >
> > On 4/5/07, netflexity <mf...@netflexity.com> wrote:
> >>
> >> I need to preserve original request message and use it in case some
> >> business
> >> rule matches. Right now, I've manageed to do this with Singleton and
> >> getContext().getNamingContext().bind(), but I consider both of these
> >> solutions pretty ugly. Being a Message Broker developer, I am used to
> >> Environment, which allows to preserve state for the duration of flow
> >> execution.
> >>
> >> I tried setting properties on MessageExchange, but that only works from
> >> one
> >> node to another, not node1 to node 10.
> >
> > Have you considered configuring the Wire Tap pattern via the
> > servicemix-eip component?
> >
> >
> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap
> >
> > This pattern in the EIP component allows you to grab a copy of an
> > input message and send it wherever you want. If this were the first
> > component in your flow, you could send a copy of the request message.
> >
> > Bruce
> > --
> > perl -e 'print
> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> > );'
> >
> > Apache Geronimo - http://geronimo.apache.org/
> > Apache ActiveMQ - http://activemq.org/
> > Apache ServiceMix - http://servicemix.org/
> > Castor - http://castor.org/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9871768
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: State management between components (nodes) of a flow

Posted by netflexity <mf...@netflexity.com>.
Thanks for the suggestion, but for me it is a question of where to preserve
the message, not how. I wish there would be a unique identifier for each
execution of the flow.

Thank you.



bsnyder wrote:
> 
> On 4/5/07, netflexity <mf...@netflexity.com> wrote:
>>
>> I need to preserve original request message and use it in case some
>> business
>> rule matches. Right now, I've manageed to do this with Singleton and
>> getContext().getNamingContext().bind(), but I consider both of these
>> solutions pretty ugly. Being a Message Broker developer, I am used to
>> Environment, which allows to preserve state for the duration of flow
>> execution.
>>
>> I tried setting properties on MessageExchange, but that only works from
>> one
>> node to another, not node1 to node 10.
> 
> Have you considered configuring the Wire Tap pattern via the
> servicemix-eip component?
> 
> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap
> 
> This pattern in the EIP component allows you to grab a copy of an
> input message and send it wherever you want. If this were the first
> component in your flow, you could send a copy of the request message.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/State-management-between-components-%28nodes%29-of-a-flow-tf3532736s12049.html#a9871768
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: State management between components (nodes) of a flow

Posted by Bruce Snyder <br...@gmail.com>.
On 4/5/07, netflexity <mf...@netflexity.com> wrote:
>
> I need to preserve original request message and use it in case some business
> rule matches. Right now, I've manageed to do this with Singleton and
> getContext().getNamingContext().bind(), but I consider both of these
> solutions pretty ugly. Being a Message Broker developer, I am used to
> Environment, which allows to preserve state for the duration of flow
> execution.
>
> I tried setting properties on MessageExchange, but that only works from one
> node to another, not node1 to node 10.

Have you considered configuring the Wire Tap pattern via the
servicemix-eip component?

http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-WireTap

This pattern in the EIP component allows you to grab a copy of an
input message and send it wherever you want. If this were the first
component in your flow, you could send a copy of the request message.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/