You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Charith Wickramarachchi <ch...@gmail.com> on 2010/08/01 08:24:58 UTC

Storing Messages in the JMS Transport

Hi devs ,

While working on the patch for the JMS Based Message store i got stuck in
the place where i need to persist the Message.
Idea of persisting message is to later it can be redelivered or views later.

So in the InMemory Message store case when storing i kept the reference to
the Message context (built) and its associated endpoint.
Keeping a  reference to the Endpoint in this case is not costly since its
just an Object reference.

But keeping the Endpoint  associated with a Message Context is
bit problematic in a persistent scenario since there is no point
in serializing  the Endpoint :).
I have 2 solutions to solve this.


   1. Make all the endpoints globally accessible from the configuration
   (Even the anonymous ones Ex : say a endpoint defined in a send mediator). so
   that i need only to keep the name of the endpoint with the Message.
   2. Support Message store feature only with the Endpoints
   defined globally.

WDYT ?



-- 
Charith Dhanushka Wickramarachchi
http://charithwiki.blogspot.com/

Re: Storing Messages in the JMS Transport

Posted by Charith Wickramarachchi <ch...@gmail.com>.
Sorry the Subject of the above mail must be corrected as

Storing Messages in the JMSMessageStore

On Sun, Aug 1, 2010 at 11:54 AM, Charith Wickramarachchi <
charith.dhanushka@gmail.com> wrote:

> Hi devs ,
>
> While working on the patch for the JMS Based Message store i got stuck in
> the place where i need to persist the Message.
> Idea of persisting message is to later it can be redelivered
> or views later.
>
> So in the InMemory Message store case when storing i kept the reference to
> the Message context (built) and its associated endpoint.
> Keeping a  reference to the Endpoint in this case is not costly since its
> just an Object reference.
>
> But keeping the Endpoint  associated with a Message Context is
> bit problematic in a persistent scenario since there is no point
> in serializing  the Endpoint :).
> I have 2 solutions to solve this.
>
>
>    1. Make all the endpoints globally accessible from the configuration
>    (Even the anonymous ones Ex : say a endpoint defined in a send mediator). so
>    that i need only to keep the name of the endpoint with the Message.
>    2. Support Message store feature only with the Endpoints
>    defined globally.
>
> WDYT ?
>
>
>
> --
> Charith Dhanushka Wickramarachchi
> http://charithwiki.blogspot.com/
>
>


-- 
Charith Dhanushka Wickramarachchi
http://charithwiki.blogspot.com/

Re: Storing Messages in the JMS Transport

Posted by Ruwan Linton <ru...@gmail.com>.
+1 in general, you may also consider a identifying any configuration element
such as the 3rd mediator in the sequence bar using a identifier based on a
number and the first class entity id, for example in the above case "bar.3".

Thanks,
Ruwan

On Sun, Aug 1, 2010 at 10:01 PM, Charith Wickramarachchi <
charith.dhanushka@gmail.com> wrote:

>
>
> On Sun, Aug 1, 2010 at 7:03 PM, Ruwan Linton <ru...@gmail.com>wrote:
>
>> Charith,
>>
>> I think the problem you have to solve is more broader :-) you have to keep
>> the complete state of the message, meaning what is its endpoint, ow it
>> reached this endpoint, for example if it is via a proxy foo, you need to
>> make sure that the response message after delivering it later gets
>> dispatched to the out sequence of the proxy, or if there are any other
>> mediators after the send (endpoint) you need to remember those to execute
>> that rest of the sequence after delivering the message and so forth.
>>
>> So ideally what we should be doing is to keep a reference to the
>> configuration in its complete serialization format. So in effect you need to
>> build up a referencing mechanism to refer to any bit of the synapse
>> configuration, that way we can support message persistence not only for
>> messages sending out, but also for any mediation, in the future. :-)
>>
>>
> Thanks for the feed back.
>
>
>    I'll come up with a design for this soon. At a high level i feel like
> this can be achieved by keeping a JNDI Context at the Synpase Environment
> and using a string based naming syntax to uniquely lookup any point in the
> configuration. We can populate the Context while building the Synapse
> configuration model.
>
> WDYT?
>
>
>
>> Thanks,
>> Ruwan
>>
>>
>> On Sun, Aug 1, 2010 at 6:43 PM, Charith Wickramarachchi <
>> charith.dhanushka@gmail.com> wrote:
>>
>>> Thanks for the reply.
>>>
>>> On Sun, Aug 1, 2010 at 6:25 PM, Paul Fremantle <pz...@gmail.com> wrote:
>>>
>>>> Why do you object to serializing the endpoint?
>>>
>>> Seems like it would be
>>>> the right thing to do.
>>>
>>>
>>>     Here what i mean by serializing is serializing it to a ObjectMessage
>>> in JMS.
>>>
>>>
>>>> Can't it be serialized as a <wsa:to> address in
>>>> the message header?
>>>>
>>>
>>>   If i do that, in a re delivery scenario will i be able to use the
>>> original endpoint to re-deliver the message ?.
>>>    -- Charith
>>>
>>>>
>>>> Paul
>>>>
>>>> On Sun, Aug 1, 2010 at 7:24 AM, Charith Wickramarachchi
>>>> <ch...@gmail.com> wrote:
>>>> > Hi devs ,
>>>> > While working on the patch for the JMS Based Message store i got stuck
>>>> in
>>>> > the place where i need to persist the Message.
>>>> > Idea of persisting message is to later it can be redelivered
>>>> or views later.
>>>> > So in the InMemory Message store case when storing i kept
>>>> the reference to
>>>> > the Message context (built) and its associated endpoint.
>>>> > Keeping a  reference to the Endpoint in this case is not costly since
>>>> its
>>>> > just an Object reference.
>>>> > But keeping the Endpoint  associated with a Message Context is
>>>> > bit problematic in a persistent scenario since there is no point
>>>> > in serializing  the Endpoint :).
>>>> > I have 2 solutions to solve this.
>>>> >
>>>> > Make all the endpoints globally accessible from the configuration
>>>> (Even
>>>> > the anonymous ones Ex : say a endpoint defined in a send mediator). so
>>>> that
>>>> > i need only to keep the name of the endpoint with the Message.
>>>> > Support Message store feature only with the Endpoints
>>>> defined globally.
>>>> >
>>>> > WDYT ?
>>>> >
>>>> > --
>>>> > Charith Dhanushka Wickramarachchi
>>>> > http://charithwiki.blogspot.com/
>>>> >
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> Paul Fremantle
>>>> Co-Founder and CTO, WSO2
>>>> Apache Synapse PMC Chair
>>>> OASIS WS-RX TC Co-chair
>>>>
>>>> blog: http://pzf.fremantle.org
>>>> paul@wso2.com
>>>>
>>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Charith Dhanushka Wickramarachchi
>>> http://charithwiki.blogspot.com/
>>>
>>>
>>
>>
>> --
>> Ruwan Linton
>> Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb
>> WSO2 Inc.; http://wso2.org
>>
>> Lean . Enterprise . Middleware
>>
>> phone: +1 408 754 7388 ext 51789
>> email: ruwan@wso2.com; cell: +94 77 341 3097
>> blog: http://blog.ruwan.org
>> linkedin: http://www.linkedin.com/in/ruwanlinton
>> google: http://www.google.com/profiles/ruwan.linton
>> tweet: http://twitter.com/ruwanlinton
>>
>
>
>
> --
> Charith Dhanushka Wickramarachchi
> http://charithwiki.blogspot.com/
>
>


-- 
Ruwan Linton
Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org

Lean . Enterprise . Middleware

phone: +1 408 754 7388 ext 51789
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Re: Storing Messages in the JMS Transport

Posted by Charith Wickramarachchi <ch...@gmail.com>.
On Sun, Aug 1, 2010 at 7:03 PM, Ruwan Linton <ru...@gmail.com> wrote:

> Charith,
>
> I think the problem you have to solve is more broader :-) you have to keep
> the complete state of the message, meaning what is its endpoint, ow it
> reached this endpoint, for example if it is via a proxy foo, you need to
> make sure that the response message after delivering it later gets
> dispatched to the out sequence of the proxy, or if there are any other
> mediators after the send (endpoint) you need to remember those to execute
> that rest of the sequence after delivering the message and so forth.
>
> So ideally what we should be doing is to keep a reference to the
> configuration in its complete serialization format. So in effect you need to
> build up a referencing mechanism to refer to any bit of the synapse
> configuration, that way we can support message persistence not only for
> messages sending out, but also for any mediation, in the future. :-)
>
>
Thanks for the feed back.


   I'll come up with a design for this soon. At a high level i feel like
this can be achieved by keeping a JNDI Context at the Synpase Environment
and using a string based naming syntax to uniquely lookup any point in the
configuration. We can populate the Context while building the Synapse
configuration model.

WDYT?



> Thanks,
> Ruwan
>
>
> On Sun, Aug 1, 2010 at 6:43 PM, Charith Wickramarachchi <
> charith.dhanushka@gmail.com> wrote:
>
>> Thanks for the reply.
>>
>> On Sun, Aug 1, 2010 at 6:25 PM, Paul Fremantle <pz...@gmail.com> wrote:
>>
>>> Why do you object to serializing the endpoint?
>>
>> Seems like it would be
>>> the right thing to do.
>>
>>
>>     Here what i mean by serializing is serializing it to a ObjectMessage
>> in JMS.
>>
>>
>>> Can't it be serialized as a <wsa:to> address in
>>> the message header?
>>>
>>
>>   If i do that, in a re delivery scenario will i be able to use the
>> original endpoint to re-deliver the message ?.
>>    -- Charith
>>
>>>
>>> Paul
>>>
>>> On Sun, Aug 1, 2010 at 7:24 AM, Charith Wickramarachchi
>>> <ch...@gmail.com> wrote:
>>> > Hi devs ,
>>> > While working on the patch for the JMS Based Message store i got stuck
>>> in
>>> > the place where i need to persist the Message.
>>> > Idea of persisting message is to later it can be redelivered
>>> or views later.
>>> > So in the InMemory Message store case when storing i kept
>>> the reference to
>>> > the Message context (built) and its associated endpoint.
>>> > Keeping a  reference to the Endpoint in this case is not costly since
>>> its
>>> > just an Object reference.
>>> > But keeping the Endpoint  associated with a Message Context is
>>> > bit problematic in a persistent scenario since there is no point
>>> > in serializing  the Endpoint :).
>>> > I have 2 solutions to solve this.
>>> >
>>> > Make all the endpoints globally accessible from the configuration (Even
>>> > the anonymous ones Ex : say a endpoint defined in a send mediator). so
>>> that
>>> > i need only to keep the name of the endpoint with the Message.
>>> > Support Message store feature only with the Endpoints defined globally.
>>> >
>>> > WDYT ?
>>> >
>>> > --
>>> > Charith Dhanushka Wickramarachchi
>>> > http://charithwiki.blogspot.com/
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Paul Fremantle
>>> Co-Founder and CTO, WSO2
>>> Apache Synapse PMC Chair
>>> OASIS WS-RX TC Co-chair
>>>
>>> blog: http://pzf.fremantle.org
>>> paul@wso2.com
>>>
>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>>
>> --
>> Charith Dhanushka Wickramarachchi
>> http://charithwiki.blogspot.com/
>>
>>
>
>
> --
> Ruwan Linton
> Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb
> WSO2 Inc.; http://wso2.org
>
> Lean . Enterprise . Middleware
>
> phone: +1 408 754 7388 ext 51789
> email: ruwan@wso2.com; cell: +94 77 341 3097
> blog: http://blog.ruwan.org
> linkedin: http://www.linkedin.com/in/ruwanlinton
> google: http://www.google.com/profiles/ruwan.linton
> tweet: http://twitter.com/ruwanlinton
>



-- 
Charith Dhanushka Wickramarachchi
http://charithwiki.blogspot.com/

Re: Storing Messages in the JMS Transport

Posted by Ruwan Linton <ru...@gmail.com>.
Charith,

I think the problem you have to solve is more broader :-) you have to keep
the complete state of the message, meaning what is its endpoint, ow it
reached this endpoint, for example if it is via a proxy foo, you need to
make sure that the response message after delivering it later gets
dispatched to the out sequence of the proxy, or if there are any other
mediators after the send (endpoint) you need to remember those to execute
that rest of the sequence after delivering the message and so forth.

So ideally what we should be doing is to keep a reference to the
configuration in its complete serialization format. So in effect you need to
build up a referencing mechanism to refer to any bit of the synapse
configuration, that way we can support message persistence not only for
messages sending out, but also for any mediation, in the future. :-)

Thanks,
Ruwan

On Sun, Aug 1, 2010 at 6:43 PM, Charith Wickramarachchi <
charith.dhanushka@gmail.com> wrote:

> Thanks for the reply.
>
> On Sun, Aug 1, 2010 at 6:25 PM, Paul Fremantle <pz...@gmail.com> wrote:
>
>> Why do you object to serializing the endpoint?
>
> Seems like it would be
>> the right thing to do.
>
>
>     Here what i mean by serializing is serializing it to a ObjectMessage in
> JMS.
>
>
>> Can't it be serialized as a <wsa:to> address in
>> the message header?
>>
>
>   If i do that, in a re delivery scenario will i be able to use the
> original endpoint to re-deliver the message ?.
>    -- Charith
>
>>
>> Paul
>>
>> On Sun, Aug 1, 2010 at 7:24 AM, Charith Wickramarachchi
>> <ch...@gmail.com> wrote:
>> > Hi devs ,
>> > While working on the patch for the JMS Based Message store i got stuck
>> in
>> > the place where i need to persist the Message.
>> > Idea of persisting message is to later it can be redelivered
>> or views later.
>> > So in the InMemory Message store case when storing i kept
>> the reference to
>> > the Message context (built) and its associated endpoint.
>> > Keeping a  reference to the Endpoint in this case is not costly since
>> its
>> > just an Object reference.
>> > But keeping the Endpoint  associated with a Message Context is
>> > bit problematic in a persistent scenario since there is no point
>> > in serializing  the Endpoint :).
>> > I have 2 solutions to solve this.
>> >
>> > Make all the endpoints globally accessible from the configuration (Even
>> > the anonymous ones Ex : say a endpoint defined in a send mediator). so
>> that
>> > i need only to keep the name of the endpoint with the Message.
>> > Support Message store feature only with the Endpoints defined globally.
>> >
>> > WDYT ?
>> >
>> > --
>> > Charith Dhanushka Wickramarachchi
>> > http://charithwiki.blogspot.com/
>> >
>> >
>>
>>
>>
>> --
>> Paul Fremantle
>> Co-Founder and CTO, WSO2
>> Apache Synapse PMC Chair
>> OASIS WS-RX TC Co-chair
>>
>> blog: http://pzf.fremantle.org
>> paul@wso2.com
>>
>> "Oxygenating the Web Service Platform", www.wso2.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
>
> --
> Charith Dhanushka Wickramarachchi
> http://charithwiki.blogspot.com/
>
>


-- 
Ruwan Linton
Software Architect & Product Manager, WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org

Lean . Enterprise . Middleware

phone: +1 408 754 7388 ext 51789
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Re: Storing Messages in the JMS Transport

Posted by Charith Wickramarachchi <ch...@gmail.com>.
Thanks for the reply.

On Sun, Aug 1, 2010 at 6:25 PM, Paul Fremantle <pz...@gmail.com> wrote:

> Why do you object to serializing the endpoint?

Seems like it would be
> the right thing to do.


    Here what i mean by serializing is serializing it to a ObjectMessage in
JMS.


> Can't it be serialized as a <wsa:to> address in
> the message header?
>

  If i do that, in a re delivery scenario will i be able to use the original
endpoint to re-deliver the message ?.
   -- Charith

>
> Paul
>
> On Sun, Aug 1, 2010 at 7:24 AM, Charith Wickramarachchi
> <ch...@gmail.com> wrote:
> > Hi devs ,
> > While working on the patch for the JMS Based Message store i got stuck in
> > the place where i need to persist the Message.
> > Idea of persisting message is to later it can be redelivered
> or views later.
> > So in the InMemory Message store case when storing i kept
> the reference to
> > the Message context (built) and its associated endpoint.
> > Keeping a  reference to the Endpoint in this case is not costly since its
> > just an Object reference.
> > But keeping the Endpoint  associated with a Message Context is
> > bit problematic in a persistent scenario since there is no point
> > in serializing  the Endpoint :).
> > I have 2 solutions to solve this.
> >
> > Make all the endpoints globally accessible from the configuration (Even
> > the anonymous ones Ex : say a endpoint defined in a send mediator). so
> that
> > i need only to keep the name of the endpoint with the Message.
> > Support Message store feature only with the Endpoints defined globally.
> >
> > WDYT ?
> >
> > --
> > Charith Dhanushka Wickramarachchi
> > http://charithwiki.blogspot.com/
> >
> >
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Charith Dhanushka Wickramarachchi
http://charithwiki.blogspot.com/

Re: Storing Messages in the JMS Transport

Posted by Paul Fremantle <pz...@gmail.com>.
Why do you object to serializing the endpoint? Seems like it would be
the right thing to do. Can't it be serialized as a <wsa:to> address in
the message header?

Paul

On Sun, Aug 1, 2010 at 7:24 AM, Charith Wickramarachchi
<ch...@gmail.com> wrote:
> Hi devs ,
> While working on the patch for the JMS Based Message store i got stuck in
> the place where i need to persist the Message.
> Idea of persisting message is to later it can be redelivered or views later.
> So in the InMemory Message store case when storing i kept the reference to
> the Message context (built) and its associated endpoint.
> Keeping a  reference to the Endpoint in this case is not costly since its
> just an Object reference.
> But keeping the Endpoint  associated with a Message Context is
> bit problematic in a persistent scenario since there is no point
> in serializing  the Endpoint :).
> I have 2 solutions to solve this.
>
> Make all the endpoints globally accessible from the configuration (Even
> the anonymous ones Ex : say a endpoint defined in a send mediator). so that
> i need only to keep the name of the endpoint with the Message.
> Support Message store feature only with the Endpoints defined globally.
>
> WDYT ?
>
> --
> Charith Dhanushka Wickramarachchi
> http://charithwiki.blogspot.com/
>
>



-- 
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org