You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by ant elder <an...@gmail.com> on 2006/01/12 17:09:10 UTC

Require ?

Why does Synapse require users to have <engage-addressing-in/> in their
config? Synapse should sort this out automatically.

All <engage-addressing-in/> does is set things up so that the SynapseMessage
WSA getters/setters work correctly, it doesn't actually do anything to the
message.

If a mediator calls SynapseMessage.getTo without first engaging addressing
then null will be returned whether or not there is any WSA header. If a
mediator calls setTo and then later in the config addressing is engaged then
what the previous mediator set will get overwritten. What if a mediator sets
a WSA header and then another mediator wants to get a different header? -
You must have <engage-addressing-in/> before both of these mediators for
this to work correctly.

All that seems messy and error prone. A user should be able to write a
mediator that uses WSA headers without having to think about the order of
other mediators or what else is in the config.

We can fix this by having Synapse do the engage addressing processing
automatically the first time any of the SynapseMessage WSA getters/setters
are called.  And it simplifies the Synapse config XML.

Outbound WSA headers are a different story, it does seem reasonable to have
something like <engage-addressing-out/> or a WSA-Required property on the
Send mediator so that a user can control if the outgoing message includes
the WSA headers (and what WSA version).

   ...ant

On 1/6/06, Paul Fremantle <pz...@gmail.com> wrote:
>
> Ant
>
> My only concern is that I think Synapse will be more useable if the
> semantics of any flow are visible. Which means not running addressing unless
> its told to.
>
> Paul
>
> On 1/6/06, ant elder <an...@gmail.com> wrote:
> >
> > The benefit is not forcing everyone to nearly always put <engage-addressing-in/>
> > in their synapse.xml
> >
> > The requirements are:
> >
> > 1) Some mediators require addressing headers, some don't
> > 2) Some mediators require addressing headers but aren't invoked through
> > an AxisEngine
> > 3) Don't want addressing module to run multiple times due to overwriting
> > altered headers
> > 4) Sometimes addressing headers aren't required at all so don't want
> > addressing module run (for performance?)
> >
> > So the current solution  is:
> >
> > A) Require explicit addressing when and where required in synapse.xml
> >
> > But there are other solutions:
> >
> > B) Synapse by default always calls addressing at start for every
> > message. Optional <dont-engage-addressing/> for (4)
> >
> > C) Have a way for mediators to indicate they require addressing so
> > Synapse can engage the module when required. And Synapse knows if it was
> > already engaged for a previous mediator so only engages it once. (Or have
> > the Axis2 addressing code itself see its already run so doesn't need to
> > again)
> >
> > Maybe I don't understand the Axis2 module stuff properly, but is there
> > also:
> >
> > D) Iff a Mediator calls one of the WSA getter's/setters on
> > SynapseMessage then if it hasn't already the addressing code gets run to
> > populate the  fields
> >
> > Surely (4) isn't so common, all of Synapse samples use addressing. So
> > isn't (B) more appropriate than (A) for now, and look at  (C) or (D) for
> > later?
> >
> >    ...ant
> >
> > On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
> > >
> > > Ant
> > >
> > > I don't agree that synapse should always do addressing. Firstly, if we
> > > have addressing engaged and we make multiple passes through Axis then it
> > > overwrites the To/From/etc properties in the SynapseMessage every time.
> > > Secondly, I don't agree that we always want to parse those headers. In
> > > fact we decided at the very first F2F not to.
> > >
> > > We started out making every mediator a pass through Axis2 for a
> > > specific benefit - QoS. However, we now have an alternative model to get
> > > those QoSs (the emptymessagereceiver) and I don't see the benefit. I think
> > > there is a clearer model between Axis2 and Synapse if we only call back into
> > > Axis2 when we need a specific Axis2 service.
> > >
> > > Paul
> > >
> > > On 1/6/06, ant elder < ant.elder@gmail.com> wrote:
> > > >
> > > > Is the ClassMediator really needed?
> > > >
> > > > In yesterdays IRC chat there was some discussion about mediators
> > > > being Axis2 services vs. the ClassMediator which calls a Java class directly
> > > > without going through an Axis engine. It was said the ClassMediator is
> > > > easier to use as you don't need a service xml and is faster.
> > > >
> > > > Are these the only reasons for having the ClassMediator? Wouldn't
> > > > having Synapse auto-deploy to Axis2 (as Glen suggested) fix the complexity
> > > > problem, and if it really is so slow going through an empty AxisEngine
> > > > shouldn't we try to get the Axis2 guys to fix that instead of us just not
> > > > using Axis? Surely a pass through an empty engine should just be a few empty
> > > > loops and a bunch of if statements which shouldn't add so much overhead?
> > > >
> > > > One thing this would help with is with the addressing stuff. i don't
> > > > really like having <engage-addressing-in/> explicitly in the Synapse XML.
> > > > Shouldn't Synapse just know when addressing is required? If you have a
> > > > Mediator the routes based on a WSA header then if the mediator was an Axis2
> > > > service the addressing stuff could be engaged automatically on the pass
> > > > through the engine.
> > > >
> > > >    ...ant
> > > >
> > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>

Re: Require ?

Posted by Eran Chinthaka <ch...@opensource.lk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 


ant elder wrote:

> So this sets the global default of whether or not to use addressing
> on outgoing messages doesn't it?

Nope. If you set this to MessageContext, this is per message. Likewise
it depends on where you set this. If you want to make this global, set
this in ConfigContext.

> Thats useful but doesn't Synapse also need to be able to set this
> for individual messages? And to say what version of addressing to
> use?

You can set anyContext.setProperty(WS_ADDRESSING_VERSION,
WSAVersionNSURI). For example,
msgContext.setProperty(WS_ADDRESSING_VERSION,
"http://www.w3.org/2005/08/addressing") will set the addressing
2005/08 version for *this* OUT message.

- -- Chinthaka


>
> ...ant
>
> On 1/16/06, Saminda Abeyruwan <sa...@gmail.com> wrote:
>
>> Hi,
>>
>> Please see my comment below. Thank you.
>>
>> On 1/12/06, ant elder <an...@gmail.com> wrote:
>>
>>> Why does Synapse require users to have <engage-addressing-in/>
>>> in their config? Synapse should sort this out automatically.
>>
>>
>> Please see commit message r365848.
>>
>> All <engage-addressing-in/> does is set things up so that the
>> SynapseMessage
>>
>>> WSA getters/setters work correctly, it doesn't actually do
>>> anything to the message.
>>>
>>> If a mediator calls SynapseMessage.getTo without first engaging
>>> addressing then null will be returned whether or not there is
>>> any WSA header . If a mediator calls setTo and then later in
>>> the config addressing is engaged then what the previous
>>> mediator set will get overwritten. What if a mediator sets a
>>> WSA header and then another mediator wants to get a different
>>> header? - You must have <engage-addressing-in/> before both of
>>> these mediators for this to work correctly.
>>
>>
>>
>>
>> All that seems messy and error prone. A user should be able to
>> write a
>>
>>> mediator that uses WSA headers without having to think about
>>> the order of other mediators or what else is in the config .
>>
>>
>>
>>
>> We can fix this by having Synapse do the engage addressing
>> processing
>>
>>> automatically the first time any of the SynapseMessage WSA
>>> getters/setters are called. And it simplifies the Synapse
>>> config XML.
>>>
>>> Outbound WSA headers are a different story, it does seem
>>> reasonable to have something like <engage-addressing-out/> or a
>>> WSA-Required property on the Send mediator so that a user can
>>> control if the outgoing message includes the WSA headers (and
>>> what WSA version).
>>
>>
>> I agree. If you look at prior commit messages and if you run
>> through the code in Axis2Sender.send(), setting the property in
>> SynapseEnvironement (
>> org.apache.synapse.Constants.ADDRESSING_PROCESSED, Boolean.True)
>> only enage AddresingOutHandler for outbound messages. This is
>> possible because of setting
>>
>> mc.setProperty(
>>
org.apache.axis2.Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES
>> , Boolean.TRUE); to switch on/off between AddressingOutHandler.
>> This all available in commit 365848. Please be kind enough to
>> read the commit message.
>>
>> Saminda
>>
>>
>> ...ant
>>
>>> On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
>>>
>>>> Ant
>>>>
>>>> My only concern is that I think Synapse will be more useable
>>>> if the semantics of any flow are visible. Which means not
>>>> running addressing unless its told to.
>>>>
>>>> Paul
>>>>
>>>> On 1/6/06, ant elder <an...@gmail.com> wrote:
>>>>
>>>>> The benefit is not forcing everyone to nearly always put
>>>>> <engage-addressing-in/> in their synapse.xml
>>>>>
>>>>> The requirements are:
>>>>>
>>>>> 1) Some mediators require addressing headers, some don't 2)
>>>>> Some mediators require addressing headers but aren't
>>>>> invoked through an AxisEngine 3) Don't want addressing
>>>>> module to run multiple times due to overwriting altered
>>>>> headers 4) Sometimes addressing headers aren't required at
>>>>> all so don't want addressing module run (for performance?)
>>>>>
>>>>> So the current solution is:
>>>>>
>>>>> A) Require explicit addressing when and where required in
>>>>> synapse.xml
>>>>>
>>>>> But there are other solutions:
>>>>>
>>>>> B) Synapse by default always calls addressing at start for
>>>>> every message. Optional <dont-engage-addressing/> for (4)
>>>>>
>>>>> C) Have a way for mediators to indicate they require
>>>>> addressing so Synapse can engage the module when required.
>>>>> And Synapse knows if it was already engaged for a previous
>>>>> mediator so only engages it once. (Or have the Axis2
>>>>> addressing code itself see its already run so doesn't need
>>>>> to again)
>>>>>
>>>>> Maybe I don't understand the Axis2 module stuff properly,
>>>>> but is there also:
>>>>>
>>>>> D) Iff a Mediator calls one of the WSA getter's/setters on
>>>>> SynapseMessage then if it hasn't already the addressing
>>>>> code gets run to populate the fields
>>>>>
>>>>> Surely (4) isn't so common, all of Synapse samples use
>>>>> addressing. So isn't (B) more appropriate than (A) for now,
>>>>> and look at (C) or (D) for later?
>>>>>
>>>>> ...ant
>>>>>
>>>>> On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
>>>>>
>>>>>> Ant
>>>>>>
>>>>>> I don't agree that synapse should always do addressing.
>>>>>> Firstly, if we have addressing engaged and we make
>>>>>> multiple passes through Axis then it overwrites the
>>>>>> To/From/etc properties in the SynapseMessage every time.
>>>>>> Secondly, I don't agree that we always want to parse
>>>>>> those headers. In fact we decided at the very first F2F
>>>>>> not to.
>>>>>>
>>>>>> We started out making every mediator a pass through Axis2
>>>>>> for a specific benefit - QoS. However, we now have an
>>>>>> alternative model to get those QoSs (the
>>>>>> emptymessagereceiver) and I don't see the benefit. I
>>>>>> think there is a clearer model between Axis2 and Synapse
>>>>>> if we only call back into Axis2 when we need a specific
>>>>>> Axis2 service.
>>>>>>
>>>>>> Paul
>>>>>>
>>>>>> On 1/6/06, ant elder < ant.elder@gmail.com> wrote:
>>>>>>
>>>>>>> Is the ClassMediator really needed?
>>>>>>>
>>>>>>> In yesterdays IRC chat there was some discussion about
>>>>>>> mediators being Axis2 services vs. the ClassMediator
>>>>>>> which calls a Java class directly without going through
>>>>>>> an Axis engine. It was said the ClassMediator is easier
>>>>>>> to use as you don't need a service xml and is faster.
>>>>>>>
>>>>>>> Are these the only reasons for having the
>>>>>>> ClassMediator? Wouldn't having Synapse auto-deploy to
>>>>>>> Axis2 (as Glen suggested) fix the complexity problem,
>>>>>>> and if it really is so slow going through an empty
>>>>>>> AxisEngine shouldn't we try to get the Axis2 guys to
>>>>>>> fix that instead of us just not using Axis? Surely a
>>>>>>> pass through an empty engine should just be a few empty
>>>>>>> loops and a bunch of if statements which shouldn't add
>>>>>>> so much overhead?
>>>>>>>
>>>>>>> One thing this would help with is with the addressing
>>>>>>> stuff. i don't really like having
>>>>>>> <engage-addressing-in/> explicitly in the Synapse XML.
>>>>>>> Shouldn't Synapse just know when addressing is
>>>>>>> required? If you have a Mediator the routes based on a
>>>>>>> WSA header then if the mediator was an Axis2 service
>>>>>>> the addressing stuff could be engaged automatically on
>>>>>>> the pass through the engine.
>>>>>>>
>>>>>>> ...ant
>>>>>>>
>>>>>>
>>>>>>
>>>>>> -- Paul Fremantle VP/Technology, WSO2 and OASIS WS-RX TC
>>>>>> Co-chair
>>>>>>
>>>>>> http://bloglines.com/blog/paulfremantle paul@wso2.com
>>>>>>
>>>>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>>>>
>>>>>
>>>>
>>>> -- Paul Fremantle VP/Technology, WSO2 and OASIS WS-RX TC
>>>> Co-chair
>>>>
>>>> http://bloglines.com/blog/paulfremantle paul@wso2.com
>>>>
>>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>>
>>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
 
iD8DBQFDy9mmjON2uBzUhh8RAulGAJ4+XpBCK39tQpdBzC8+IUMcCFQ2rwCcCgJT
qCuZcp4+mdpxMi+H1G4YFMo=
=gjYT
-----END PGP SIGNATURE-----


Re: Require ?

Posted by ant elder <an...@gmail.com>.
So this sets the global default of whether or not to use addressing on
outgoing messages doesn't it? Thats useful but doesn't Synapse also need to
be able to set this for individual messages? And to say what version of
addressing to use?

   ...ant

On 1/16/06, Saminda Abeyruwan <sa...@gmail.com> wrote:
>
> Hi,
>
> Please see my comment below. Thank you.
>
> On 1/12/06, ant elder <an...@gmail.com> wrote:
> >
> > Why does Synapse require users to have <engage-addressing-in/> in their
> > config? Synapse should sort this out automatically.
>
>
> Please see commit message r365848.
>
> All <engage-addressing-in/> does is set things up so that the SynapseMessage
> > WSA getters/setters work correctly, it doesn't actually do anything to
> > the message.
> >
> > If a mediator calls SynapseMessage.getTo without first engaging
> > addressing then null will be returned whether or not there is any WSA header
> > . If a mediator calls setTo and then later in the config addressing is
> > engaged then what the previous mediator set will get overwritten. What if a
> > mediator sets a WSA header and then another mediator wants to get a
> > different header? - You must have <engage-addressing-in/> before both of
> > these mediators for this to work correctly.
>
>
>
>
> All that seems messy and error prone. A user should be able to write a
> > mediator that uses WSA headers without having to think about the order of
> > other mediators or what else is in the config .
>
>
>
>
> We can fix this by having Synapse do the engage addressing processing
> > automatically the first time any of the SynapseMessage WSA getters/setters
> > are called.  And it simplifies the Synapse config XML.
> >
> > Outbound WSA headers are a different story, it does seem reasonable to
> > have something like <engage-addressing-out/> or a WSA-Required property
> > on the Send mediator so that a user can control if the outgoing message
> > includes the WSA headers (and what WSA version).
>
>
> I agree. If you look at prior commit messages and if you run through the
> code in Axis2Sender.send(), setting the property in SynapseEnvironement (
> org.apache.synapse.Constants.ADDRESSING_PROCESSED, Boolean.True) only
> enage AddresingOutHandler for outbound messages. This is possible because of
> setting
>
> mc.setProperty(
> org.apache.axis2.Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES
> ,
>                                 Boolean.TRUE);
> to switch on/off between AddressingOutHandler. This all available in
> commit 365848. Please be kind enough to read the commit message.
>
> Saminda
>
>
>    ...ant
> >
> > On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
> > >
> > > Ant
> > >
> > > My only concern is that I think Synapse will be more useable if the
> > > semantics of any flow are visible. Which means not running addressing unless
> > > its told to.
> > >
> > > Paul
> > >
> > > On 1/6/06, ant elder <an...@gmail.com> wrote:
> > > >
> > > > The benefit is not forcing everyone to nearly always put <engage-addressing-in/>
> > > > in their synapse.xml
> > > >
> > > > The requirements are:
> > > >
> > > > 1) Some mediators require addressing headers, some don't
> > > > 2) Some mediators require addressing headers but aren't invoked
> > > > through an AxisEngine
> > > > 3) Don't want addressing module to run multiple times due to
> > > > overwriting altered headers
> > > > 4) Sometimes addressing headers aren't required at all so don't want
> > > > addressing module run (for performance?)
> > > >
> > > > So the current solution  is:
> > > >
> > > > A) Require explicit addressing when and where required in
> > > > synapse.xml
> > > >
> > > > But there are other solutions:
> > > >
> > > > B) Synapse by default always calls addressing at start for every
> > > > message. Optional <dont-engage-addressing/> for (4)
> > > >
> > > > C) Have a way for mediators to indicate they require addressing so
> > > > Synapse can engage the module when required. And Synapse knows if it was
> > > > already engaged for a previous mediator so only engages it once. (Or have
> > > > the Axis2 addressing code itself see its already run so doesn't need to
> > > > again)
> > > >
> > > > Maybe I don't understand the Axis2 module stuff properly, but is
> > > > there also:
> > > >
> > > > D) Iff a Mediator calls one of the WSA getter's/setters on
> > > > SynapseMessage then if it hasn't already the addressing code gets run to
> > > > populate the  fields
> > > >
> > > > Surely (4) isn't so common, all of Synapse samples use addressing.
> > > > So isn't (B) more appropriate than (A) for now, and look at  (C) or (D) for
> > > > later?
> > > >
> > > >    ...ant
> > > >
> > > > On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
> > > > >
> > > > > Ant
> > > > >
> > > > > I don't agree that synapse should always do addressing. Firstly,
> > > > > if we have addressing engaged and we make multiple passes through Axis then
> > > > > it overwrites the To/From/etc properties in the SynapseMessage every time.
> > > > > Secondly, I don't agree that we always want to parse those
> > > > > headers. In fact we decided at the very first F2F not to.
> > > > >
> > > > > We started out making every mediator a pass through Axis2 for a
> > > > > specific benefit - QoS. However, we now have an alternative model to get
> > > > > those QoSs (the emptymessagereceiver) and I don't see the benefit. I think
> > > > > there is a clearer model between Axis2 and Synapse if we only call back into
> > > > > Axis2 when we need a specific Axis2 service.
> > > > >
> > > > > Paul
> > > > >
> > > > > On 1/6/06, ant elder < ant.elder@gmail.com> wrote:
> > > > > >
> > > > > > Is the ClassMediator really needed?
> > > > > >
> > > > > > In yesterdays IRC chat there was some discussion about mediators
> > > > > > being Axis2 services vs. the ClassMediator which calls a Java class directly
> > > > > > without going through an Axis engine. It was said the ClassMediator is
> > > > > > easier to use as you don't need a service xml and is faster.
> > > > > >
> > > > > > Are these the only reasons for having the ClassMediator?
> > > > > > Wouldn't having Synapse auto-deploy to Axis2 (as Glen suggested) fix the
> > > > > > complexity problem, and if it really is so slow going through an empty
> > > > > > AxisEngine shouldn't we try to get the Axis2 guys to fix that instead of us
> > > > > > just not using Axis? Surely a pass through an empty engine should just be a
> > > > > > few empty loops and a bunch of if statements which shouldn't add so much
> > > > > > overhead?
> > > > > >
> > > > > > One thing this would help with is with the addressing stuff. i
> > > > > > don't really like having <engage-addressing-in/> explicitly in the Synapse
> > > > > > XML. Shouldn't Synapse just know when addressing is required? If you have a
> > > > > > Mediator the routes based on a WSA header then if the mediator was an Axis2
> > > > > > service the addressing stuff could be engaged automatically on the pass
> > > > > > through the engine.
> > > > > >
> > > > > >    ...ant
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Paul Fremantle
> > > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > > >
> > > > > http://bloglines.com/blog/paulfremantle
> > > > > paul@wso2.com
> > > > >
> > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> >
> >
>

Re: Require ?

Posted by Saminda Abeyruwan <sa...@gmail.com>.
Hi,

Please see my comment below. Thank you.

On 1/12/06, ant elder <an...@gmail.com> wrote:
>
> Why does Synapse require users to have <engage-addressing-in/> in their
> config? Synapse should sort this out automatically.


Please see commit message r365848.

All <engage-addressing-in/> does is set things up so that the SynapseMessage
> WSA getters/setters work correctly, it doesn't actually do anything to the
> message.
>
> If a mediator calls SynapseMessage.getTo without first engaging addressing
> then null will be returned whether or not there is any WSA header . If a
> mediator calls setTo and then later in the config addressing is engaged then
> what the previous mediator set will get overwritten. What if a mediator sets
> a WSA header and then another mediator wants to get a different header? -
> You must have <engage-addressing-in/> before both of these mediators for
> this to work correctly.




All that seems messy and error prone. A user should be able to write a
> mediator that uses WSA headers without having to think about the order of
> other mediators or what else is in the config .




We can fix this by having Synapse do the engage addressing processing
> automatically the first time any of the SynapseMessage WSA getters/setters
> are called.  And it simplifies the Synapse config XML.
>
> Outbound WSA headers are a different story, it does seem reasonable to
> have something like <engage-addressing-out/> or a WSA-Required property on
> the Send mediator so that a user can control if the outgoing message
> includes the WSA headers (and what WSA version).


I agree. If you look at prior commit messages and if you run through the
code in Axis2Sender.send(), setting the property in SynapseEnvironement (
org.apache.synapse.Constants.ADDRESSING_PROCESSED, Boolean.True) only enage
AddresingOutHandler for outbound messages. This is possible because of
setting

mc.setProperty(
org.apache.axis2.Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES
,
                                Boolean.TRUE);
to switch on/off between AddressingOutHandler. This all available in commit
365848. Please be kind enough to read the commit message.

Saminda


   ...ant
>
> On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
> >
> > Ant
> >
> > My only concern is that I think Synapse will be more useable if the
> > semantics of any flow are visible. Which means not running addressing unless
> > its told to.
> >
> > Paul
> >
> > On 1/6/06, ant elder <an...@gmail.com> wrote:
> > >
> > > The benefit is not forcing everyone to nearly always put <engage-addressing-in/>
> > > in their synapse.xml
> > >
> > > The requirements are:
> > >
> > > 1) Some mediators require addressing headers, some don't
> > > 2) Some mediators require addressing headers but aren't invoked
> > > through an AxisEngine
> > > 3) Don't want addressing module to run multiple times due to
> > > overwriting altered headers
> > > 4) Sometimes addressing headers aren't required at all so don't want
> > > addressing module run (for performance?)
> > >
> > > So the current solution  is:
> > >
> > > A) Require explicit addressing when and where required in synapse.xml
> > >
> > > But there are other solutions:
> > >
> > > B) Synapse by default always calls addressing at start for every
> > > message. Optional <dont-engage-addressing/> for (4)
> > >
> > > C) Have a way for mediators to indicate they require addressing so
> > > Synapse can engage the module when required. And Synapse knows if it was
> > > already engaged for a previous mediator so only engages it once. (Or have
> > > the Axis2 addressing code itself see its already run so doesn't need to
> > > again)
> > >
> > > Maybe I don't understand the Axis2 module stuff properly, but is there
> > > also:
> > >
> > > D) Iff a Mediator calls one of the WSA getter's/setters on
> > > SynapseMessage then if it hasn't already the addressing code gets run to
> > > populate the  fields
> > >
> > > Surely (4) isn't so common, all of Synapse samples use addressing. So
> > > isn't (B) more appropriate than (A) for now, and look at  (C) or (D) for
> > > later?
> > >
> > >    ...ant
> > >
> > > On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
> > > >
> > > > Ant
> > > >
> > > > I don't agree that synapse should always do addressing. Firstly, if
> > > > we have addressing engaged and we make multiple passes through Axis then it
> > > > overwrites the To/From/etc properties in the SynapseMessage every time.
> > > > Secondly, I don't agree that we always want to parse those headers.
> > > > In fact we decided at the very first F2F not to.
> > > >
> > > > We started out making every mediator a pass through Axis2 for a
> > > > specific benefit - QoS. However, we now have an alternative model to get
> > > > those QoSs (the emptymessagereceiver) and I don't see the benefit. I think
> > > > there is a clearer model between Axis2 and Synapse if we only call back into
> > > > Axis2 when we need a specific Axis2 service.
> > > >
> > > > Paul
> > > >
> > > > On 1/6/06, ant elder < ant.elder@gmail.com> wrote:
> > > > >
> > > > > Is the ClassMediator really needed?
> > > > >
> > > > > In yesterdays IRC chat there was some discussion about mediators
> > > > > being Axis2 services vs. the ClassMediator which calls a Java class directly
> > > > > without going through an Axis engine. It was said the ClassMediator is
> > > > > easier to use as you don't need a service xml and is faster.
> > > > >
> > > > > Are these the only reasons for having the ClassMediator? Wouldn't
> > > > > having Synapse auto-deploy to Axis2 (as Glen suggested) fix the complexity
> > > > > problem, and if it really is so slow going through an empty AxisEngine
> > > > > shouldn't we try to get the Axis2 guys to fix that instead of us just not
> > > > > using Axis? Surely a pass through an empty engine should just be a few empty
> > > > > loops and a bunch of if statements which shouldn't add so much overhead?
> > > > >
> > > > > One thing this would help with is with the addressing stuff. i
> > > > > don't really like having <engage-addressing-in/> explicitly in the Synapse
> > > > > XML. Shouldn't Synapse just know when addressing is required? If you have a
> > > > > Mediator the routes based on a WSA header then if the mediator was an Axis2
> > > > > service the addressing stuff could be engaged automatically on the pass
> > > > > through the engine.
> > > > >
> > > > >    ...ant
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > >
> > > > http://bloglines.com/blog/paulfremantle
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>

Re: Require ?

Posted by Eran Chinthaka <ch...@opensource.lk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hi Sanjiva and all,

Sanjiva Weerawarana wrote:

> On Sun, 2006-01-15 at 15:06 +0000, Paul Fremantle wrote:
>
>> Eran
>>
>> How do I use it? I have a whole bunch of hokey code in order to
>> turn off addressing, and wasted a morning getting it working when
>> we ported to 0.94 because I missed something obvious in amongst
>> the hokey code!
>
>
> I just looked at the addressing out handler and it has this code:
>
> Boolean property = (Boolean)
> msgContext.getProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
> if (property != null && property.booleanValue()) {
> log.info("Addressing is disbaled ....."); return; }
>
> So .. I guess all that needs to happen is to set the property
> org.apache.axis2.Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES
> to true somewhere!
>
Yeah, this is exactly what you have to do.

> Sorry Paul; I guess this went thru somewhere without the necessary
> message to synapse-dev! :(.
>
> Oh and BTW, this is why I don't like using properties .. you have
> to know the names of properties to be able to make use of them. If
> there were methods then its more immediately visible. Anyway.

Well, the problem with methods is that once you introduce a new
method, the stub templates also must be changed with that. And we
(axis2 ppl) know that this is not happening all the times, even though
it is trivial.
And another problem is that, you will see hundreds of methods in Options.
So we moved on or prefer properties. Finding properties should not be
harder as all the property constants are in
org.apache.axis2.Constants.Configuration.

So if you want to set sth in Axis2

Step 1 : Search for that method in Options

if not found : search for a constant ,to set that as a property, in
org.apache.axis2.Constants.Configuration.

if not found : kindly send a mail to axis-dev :-) .

Simple, isn't it ? :-D


- -- Chinthaka

>
> Sanjiva.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org For
> additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
 
iD8DBQFDywhBjON2uBzUhh8RApTcAJ0QWoIcTq2fr/9rv2o4+o0KR3/YggCbBr/8
/OkrXQnJTvAWDMSw0WeqTKs=
=0qk7
-----END PGP SIGNATURE-----


Re: Require ?

Posted by Paul Fremantle <pz...@gmail.com>.
Yes +1 to how hard it is to find these properties!!!

and THANKS for finding it :-)

Paul

On 1/15/06, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
>
> On Sun, 2006-01-15 at 15:06 +0000, Paul Fremantle wrote:
> > Eran
> >
> > How do I use it? I have a whole bunch of hokey code in order to turn
> > off addressing, and wasted a morning getting it working when we ported
> > to 0.94 because I missed something obvious in amongst the hokey code!
>
> I just looked at the addressing out handler and it has this code:
>
>         Boolean
>                 property = (Boolean)
> msgContext.getProperty(
> Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
>         if (property != null && property.booleanValue()) {
>             log.info("Addressing is disbaled .....");
>             return;
>         }
>
> So .. I guess all that needs to happen is to set the property
>
> org.apache.axis2.Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGESto true somewhere!
>
> Sorry Paul; I guess this went thru somewhere without the necessary
> message to synapse-dev! :(.
>
> Oh and BTW, this is why I don't like using properties .. you have to
> know the names of properties to be able to make use of them. If there
> were methods then its more immediately visible. Anyway.
>
> Sanjiva.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>


--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

Re: Require ?

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Sun, 2006-01-15 at 15:06 +0000, Paul Fremantle wrote:
> Eran
> 
> How do I use it? I have a whole bunch of hokey code in order to turn
> off addressing, and wasted a morning getting it working when we ported
> to 0.94 because I missed something obvious in amongst the hokey code!

I just looked at the addressing out handler and it has this code:

        Boolean
                property = (Boolean)
msgContext.getProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
        if (property != null && property.booleanValue()) {
            log.info("Addressing is disbaled .....");
            return;
        }

So .. I guess all that needs to happen is to set the property
org.apache.axis2.Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES to true somewhere!

Sorry Paul; I guess this went thru somewhere without the necessary
message to synapse-dev! :(.

Oh and BTW, this is why I don't like using properties .. you have to
know the names of properties to be able to make use of them. If there
were methods then its more immediately visible. Anyway.

Sanjiva.



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


Re: Require ?

Posted by Saminda Abeyruwan <sa...@gmail.com>.
Hi Pual,

As Eran stated, when they published, setting the property
org.apache.axis2.Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGESin
Message Context to switch on/off AddressingOutHandler {iff addressing
is
engaged}, i use it for Synapse advantage. If you happen to follow the commit
message r365848, IMHO i believe it's what this all related to. Sorry not
being able to reply sooner.

Thank you

Saminda



On 1/15/06, Paul Fremantle <pz...@gmail.com> wrote:
>
> Eran
>
> How do I use it? I have a whole bunch of hokey code in order to turn off
> addressing, and wasted a morning getting it working when we ported to 0.94because I missed something obvious in amongst the hokey code!
>
> Paul
>
> On 1/15/06, Eran Chinthaka <ch...@opensource.lk> wrote:
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> >
> >
> > Sanjiva Weerawarana wrote:
> >
> > > On Thu, 2006-01-12 at 16:09
> > +0000, ant elder wrote:
> >
> > >
> >
> > >> Outbound WSA headers are a different story, it does seem
> >
> > >> reasonable to have something like
> > <engage-addressing-out/> or a
> >
> > >> WSA-Required property on the Send mediator so that a user can
> >
> > >> control if the outgoing message includes the WSA headers (and
> >
> > >> what WSA version).
> >
> > >
> >
> > >
> >
> > > +1! In fact Eran and I discussed adding a parameter to control
> >
> > > addressing on outbound .. whether to engage or not. Its a trivial
> >
> > > thing to do and it will have the effect of disengaging WS-Addr
> >
> > > header generation on outgoing messages.
> >
> > >
> >
> > > If u guys r interested pls raise an issue against Axis2 so that
> > its
> >
> > > not forgotten.
> >
> > Sorry for not answering this earlier.(was busy with Axis2 0.94 release)
> >
> > I did the required change couple of weeks back and Saminda confirmed
> > me that it was working. Anyone had problem with this in Axis2 ? If
> > yes, let me know I will fix it for you.
> >
> > - -- Chinthaka
> >
> > >
> >
> > > Sanjiva.
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> > ---------------------------------------------------------------------
> >
> > > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org For
> >
> > > additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> > >
> >
> > >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.2 (MingW32)
> >
> > iD8DBQFDyl+ljON2uBzUhh8RAhPWAJ4hPexNnnChuKZ2r/DILVjlTonXdACfY+1c
> > 3ECshnkVF9tsmS1QnKEJVSM=
> > =FGyd
> > -----END PGP SIGNATURE-----
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>

Re: Require ?

Posted by Paul Fremantle <pz...@gmail.com>.
Eran

How do I use it? I have a whole bunch of hokey code in order to turn off
addressing, and wasted a morning getting it working when we ported to
0.94because I missed something obvious in amongst the hokey code!

Paul

On 1/15/06, Eran Chinthaka <ch...@opensource.lk> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
> Sanjiva Weerawarana wrote:
>
> > On Thu, 2006-01-12 at 16:09
> +0000, ant elder wrote:
> >
> >> Outbound WSA headers are a different story, it does seem
> >> reasonable to have something like <engage-addressing-out/> or a
> >> WSA-Required property on the Send mediator so that a user can
> >> control if the outgoing message includes the WSA headers (and
> >> what WSA version).
> >
> >
> > +1! In fact Eran and I discussed adding a parameter to control
> > addressing on outbound .. whether to engage or not. Its a trivial
> > thing to do and it will have the effect of disengaging WS-Addr
> > header generation on outgoing messages.
> >
> > If u guys r interested pls raise an issue against Axis2 so that its
> > not forgotten.
>
> Sorry for not answering this earlier.(was busy with Axis2 0.94 release)
>
> I did the required change couple of weeks back and Saminda confirmed
> me that it was working. Anyone had problem with this in Axis2 ? If
> yes, let me know I will fix it for you.
>
> - -- Chinthaka
>
> >
> > Sanjiva.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org For
> > additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
>
> iD8DBQFDyl+ljON2uBzUhh8RAhPWAJ4hPexNnnChuKZ2r/DILVjlTonXdACfY+1c
> 3ECshnkVF9tsmS1QnKEJVSM=
> =FGyd
> -----END PGP SIGNATURE-----
>
>


--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

Re: Require ?

Posted by Eran Chinthaka <ch...@opensource.lk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 


Sanjiva Weerawarana wrote:

> On Thu, 2006-01-12 at 16:09 +0000, ant elder wrote:
>
>> Outbound WSA headers are a different story, it does seem
>> reasonable to have something like <engage-addressing-out/> or a
>> WSA-Required property on the Send mediator so that a user can
>> control if the outgoing message includes the WSA headers (and
>> what WSA version).
>
>
> +1! In fact Eran and I discussed adding a parameter to control
> addressing on outbound .. whether to engage or not. Its a trivial
> thing to do and it will have the effect of disengaging WS-Addr
> header generation on outgoing messages.
>
> If u guys r interested pls raise an issue against Axis2 so that its
> not forgotten.

Sorry for not answering this earlier.(was busy with Axis2 0.94 release)

I did the required change couple of weeks back and Saminda confirmed
me that it was working. Anyone had problem with this in Axis2 ? If
yes, let me know I will fix it for you.

- -- Chinthaka

>
> Sanjiva.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org For
> additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
 
iD8DBQFDyl+ljON2uBzUhh8RAhPWAJ4hPexNnnChuKZ2r/DILVjlTonXdACfY+1c
3ECshnkVF9tsmS1QnKEJVSM=
=FGyd
-----END PGP SIGNATURE-----


Re: Require ?

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Thu, 2006-01-12 at 16:09 +0000, ant elder wrote:
> 
> Outbound WSA headers are a different story, it does seem reasonable to
> have something like <engage-addressing-out/> or a WSA-Required
> property on the Send mediator so that a user can control if the
> outgoing message includes the WSA headers (and what WSA version).

+1! In fact Eran and I discussed adding a parameter to control
addressing on outbound .. whether to engage or not. Its a trivial thing
to do and it will have the effect of disengaging WS-Addr header
generation on outgoing messages. 

If u guys r interested pls raise an issue against Axis2 so that its not
forgotten.

Sanjiva.



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


Re: Require ?

Posted by Paul Fremantle <pz...@gmail.com>.
Ant

You make a good point. I guess there is a difference between making every
mediator that changes the message explicit, and addressing that leaves the
message intact.

I agree with your point about addressing-out

Paul

On 1/12/06, ant elder <an...@gmail.com> wrote:
>
> Why does Synapse require users to have <engage-addressing-in/> in their
> config? Synapse should sort this out automatically.
>
> All <engage-addressing-in/> does is set things up so that the SynapseMessage
> WSA getters/setters work correctly, it doesn't actually do anything to the
> message.
>
> If a mediator calls SynapseMessage.getTo without first engaging addressing
> then null will be returned whether or not there is any WSA header . If a
> mediator calls setTo and then later in the config addressing is engaged then
> what the previous mediator set will get overwritten. What if a mediator sets
> a WSA header and then another mediator wants to get a different header? -
> You must have <engage-addressing-in/> before both of these mediators for
> this to work correctly.
>
> All that seems messy and error prone. A user should be able to write a
> mediator that uses WSA headers without having to think about the order of
> other mediators or what else is in the config .
>
> We can fix this by having Synapse do the engage addressing processing
> automatically the first time any of the SynapseMessage WSA getters/setters
> are called.  And it simplifies the Synapse config XML.
>
> Outbound WSA headers are a different story, it does seem reasonable to
> have something like <engage-addressing-out/> or a WSA-Required property on
> the Send mediator so that a user can control if the outgoing message
> includes the WSA headers (and what WSA version).
>
>    ...ant
>
> On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
> >
> > Ant
> >
> > My only concern is that I think Synapse will be more useable if the
> > semantics of any flow are visible. Which means not running addressing unless
> > its told to.
> >
> > Paul
> >
> > On 1/6/06, ant elder <an...@gmail.com> wrote:
> > >
> > > The benefit is not forcing everyone to nearly always put <engage-addressing-in/>
> > > in their synapse.xml
> > >
> > > The requirements are:
> > >
> > > 1) Some mediators require addressing headers, some don't
> > > 2) Some mediators require addressing headers but aren't invoked
> > > through an AxisEngine
> > > 3) Don't want addressing module to run multiple times due to
> > > overwriting altered headers
> > > 4) Sometimes addressing headers aren't required at all so don't want
> > > addressing module run (for performance?)
> > >
> > > So the current solution  is:
> > >
> > > A) Require explicit addressing when and where required in synapse.xml
> > >
> > > But there are other solutions:
> > >
> > > B) Synapse by default always calls addressing at start for every
> > > message. Optional <dont-engage-addressing/> for (4)
> > >
> > > C) Have a way for mediators to indicate they require addressing so
> > > Synapse can engage the module when required. And Synapse knows if it was
> > > already engaged for a previous mediator so only engages it once. (Or have
> > > the Axis2 addressing code itself see its already run so doesn't need to
> > > again)
> > >
> > > Maybe I don't understand the Axis2 module stuff properly, but is there
> > > also:
> > >
> > > D) Iff a Mediator calls one of the WSA getter's/setters on
> > > SynapseMessage then if it hasn't already the addressing code gets run to
> > > populate the  fields
> > >
> > > Surely (4) isn't so common, all of Synapse samples use addressing. So
> > > isn't (B) more appropriate than (A) for now, and look at  (C) or (D) for
> > > later?
> > >
> > >    ...ant
> > >
> > > On 1/6/06, Paul Fremantle <pzfreo@gmail.com > wrote:
> > > >
> > > > Ant
> > > >
> > > > I don't agree that synapse should always do addressing. Firstly, if
> > > > we have addressing engaged and we make multiple passes through Axis then it
> > > > overwrites the To/From/etc properties in the SynapseMessage every time.
> > > > Secondly, I don't agree that we always want to parse those headers.
> > > > In fact we decided at the very first F2F not to.
> > > >
> > > > We started out making every mediator a pass through Axis2 for a
> > > > specific benefit - QoS. However, we now have an alternative model to get
> > > > those QoSs (the emptymessagereceiver) and I don't see the benefit. I think
> > > > there is a clearer model between Axis2 and Synapse if we only call back into
> > > > Axis2 when we need a specific Axis2 service.
> > > >
> > > > Paul
> > > >
> > > > On 1/6/06, ant elder < ant.elder@gmail.com> wrote:
> > > > >
> > > > > Is the ClassMediator really needed?
> > > > >
> > > > > In yesterdays IRC chat there was some discussion about mediators
> > > > > being Axis2 services vs. the ClassMediator which calls a Java class directly
> > > > > without going through an Axis engine. It was said the ClassMediator is
> > > > > easier to use as you don't need a service xml and is faster.
> > > > >
> > > > > Are these the only reasons for having the ClassMediator? Wouldn't
> > > > > having Synapse auto-deploy to Axis2 (as Glen suggested) fix the complexity
> > > > > problem, and if it really is so slow going through an empty AxisEngine
> > > > > shouldn't we try to get the Axis2 guys to fix that instead of us just not
> > > > > using Axis? Surely a pass through an empty engine should just be a few empty
> > > > > loops and a bunch of if statements which shouldn't add so much overhead?
> > > > >
> > > > > One thing this would help with is with the addressing stuff. i
> > > > > don't really like having <engage-addressing-in/> explicitly in the Synapse
> > > > > XML. Shouldn't Synapse just know when addressing is required? If you have a
> > > > > Mediator the routes based on a WSA header then if the mediator was an Axis2
> > > > > service the addressing stuff could be engaged automatically on the pass
> > > > > through the engine.
> > > > >
> > > > >    ...ant
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > >
> > > > http://bloglines.com/blog/paulfremantle
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
>
>


--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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