You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Hiranya Jayathilaka <hi...@gmail.com> on 2008/06/29 16:47:21 UTC

Reading Target Address Parameter at Transport Level

Hi Devs,

Can we access the information like target address endpoints, we normally put
in the synapse configuration, at the transport level (at a transport
listener to be precise)? I want to read the target address of a proxy
service at the transport level. This is required to resolve
SYNAPSE-380<https://issues.apache.org/jira/browse/SYNAPSE-380>.
I have access to the configuration context and the AxisService object of the
proxy service.

Thanks in advance

Best Regards,
Hiranya Jayathilaka

Re: Reading Target Address Parameter at Transport Level

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi,

If there is a way to properly specify multiple target URI values in the
Synapse config as parameters this issue can be dealt with. Any ideas?

Thanks

Best Regards,
Hiranya



On Mon, Jun 30, 2008 at 9:10 AM, Asankha C. Perera <as...@wso2.com> wrote:

>  Hiranya
>
>  These limitations can be tackled by rather ugly hacks. For an example the
> above limitation can be dealt with by asking the user to specify all the
> target URI values as the value of the parameter separated by commas. Then
> the parameter value will be read and properly parsed at the transport level.
> WDYT?
>
> Always say no to ugly hacks :)!
>
> asankha
>
> --
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>
>

Re: Reading Target Address Parameter at Transport Level

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hiranya
> These limitations can be tackled by rather ugly hacks. For an example 
> the above limitation can be dealt with by asking the user to specify 
> all the target URI values as the value of the parameter separated by 
> commas. Then the parameter value will be read and properly parsed at 
> the transport level. WDYT?
Always say no to ugly hacks :)!

asankha

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: Reading Target Address Parameter at Transport Level

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi,

On Mon, Jun 30, 2008 at 8:49 AM, Hiranya Jayathilaka <hi...@gmail.com>
wrote:

> Hi,
>
> On Sun, Jun 29, 2008 at 9:45 PM, Asankha C. Perera <as...@wso2.com>
> wrote:
>
>>  Hiranya
>>
>> The description of the issue does not make me understand much about the
>> underlying problem, but some transports like JMS, Mail, VFS etc, will only
>> poll/connect on behalf of services that registers with them. So, you can get
>> the service.xml parameters (or Proxy service parameters), from the
>> AxisService, and there you could define what you want for the transport.
>> This will not make the transport Synapse specific, as Axis2 can work too
>>
>
> Reading ordinary parameters off the AxisService can be done. Problem is
> reading the target URI value mentioned in the Synapse config. But as Andreas
> has mentioned this might make the code Synapse specific. A possible
> workaround is to introduce a new parameter where the user can specify the
> target URI to connect to at the start up. However this suffers certain
> limitations like not being able to connect to more than one session at start
> up.
>

These limitations can be tackled by rather ugly hacks. For an example the
above limitation can be dealt with by asking the user to specify all the
target URI values as the value of the parameter separated by commas. Then
the parameter value will be read and properly parsed at the transport level.
WDYT?

Thanks

Best Regards,
Hiranya

>
>
> Thanks
>
> Best Regards,
> Hiranya
>
>>
>>
>> hope this helps
>> asankha
>>
>>
>> Andreas Veithen wrote:
>>
>> Transports should not contain any code specific to Synapse. Maybe you can
>> achieve your goal by creating a org.apache.synapse.Startup implementation?
>>
>> Andreas
>>
>> On 29 juin 08, at 16:47, Hiranya Jayathilaka wrote:
>>
>> Hi Devs,
>>
>> Can we access the information like target address endpoints, we normally
>> put in the synapse configuration, at the transport level (at a transport
>> listener to be precise)? I want to read the target address of a proxy
>> service at the transport level. This is required to resolve SYNAPSE-380. I
>> have access to the configuration context and the AxisService object of the
>> proxy service.
>>
>> Thanks in advance
>>
>> Best Regards,
>> Hiranya Jayathilaka
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>> --
>> Asankha C. Perera
>>
>> WSO2 - http://wso2.org
>> http://esbmagic.blogspot.com
>>
>>
>

Re: Reading Target Address Parameter at Transport Level

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi,

On Sun, Jun 29, 2008 at 9:45 PM, Asankha C. Perera <as...@wso2.com> wrote:

>  Hiranya
>
> The description of the issue does not make me understand much about the
> underlying problem, but some transports like JMS, Mail, VFS etc, will only
> poll/connect on behalf of services that registers with them. So, you can get
> the service.xml parameters (or Proxy service parameters), from the
> AxisService, and there you could define what you want for the transport.
> This will not make the transport Synapse specific, as Axis2 can work too
>

Reading ordinary parameters off the AxisService can be done. Problem is
reading the target URI value mentioned in the Synapse config. But as Andreas
has mentioned this might make the code Synapse specific. A possible
workaround is to introduce a new parameter where the user can specify the
target URI to connect to at the start up. However this suffers certain
limitations like not being able to connect to more than one session at start
up.

Thanks

Best Regards,
Hiranya

>
>
> hope this helps
> asankha
>
>
> Andreas Veithen wrote:
>
> Transports should not contain any code specific to Synapse. Maybe you can
> achieve your goal by creating a org.apache.synapse.Startup implementation?
>
> Andreas
>
> On 29 juin 08, at 16:47, Hiranya Jayathilaka wrote:
>
> Hi Devs,
>
> Can we access the information like target address endpoints, we normally
> put in the synapse configuration, at the transport level (at a transport
> listener to be precise)? I want to read the target address of a proxy
> service at the transport level. This is required to resolve SYNAPSE-380. I
> have access to the configuration context and the AxisService object of the
> proxy service.
>
> Thanks in advance
>
> Best Regards,
> Hiranya Jayathilaka
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
> --
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>
>

Re: Reading Target Address Parameter at Transport Level

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hiranya

Andreas Veithen wrote:
> As far as I understand the requirement is as follows: When the 
> transport sender transmits the first message to a given endpoint, it 
> needs to create a session with the endpoint. This operation is 
> expensive and causes a delay if the message is received and forwarded 
> by a proxy service. Since Synapse knows about the endpoints it will 
> connect to, the idea is to create these sessions in advance (at 
> startup) so that the proxy service will forward the first message 
> without delay. However the transports can't get access to the required 
> information because it is managed by Synapse specific classes.
If the above description from Andreas holds, I do not think the 
transport sender could pre-establish sessions as per requirements of 
different services. However, check how the JMS sender uses connection 
pools (if defined), which are initialized at the startup.

asankha
> On 29 juin 08, at 18:15, Asankha C. Perera wrote:
>
>> Hiranya
>>
>> The description of the issue does not make me understand much about 
>> the underlying problem, but some transports like JMS, Mail, VFS etc, 
>> will only poll/connect on behalf of services that registers with 
>> them. So, you can get the service.xml parameters (or Proxy service 
>> parameters), from the AxisService, and there you could define what 
>> you want for the transport. This will not make the transport Synapse 
>> specific, as Axis2 can work too
>>
>> hope this helps
>> asankha
>>
>> Andreas Veithen wrote:
>>> Transports should not contain any code specific to Synapse. Maybe 
>>> you can achieve your goal by creating a org.apache.synapse.Startup 
>>> implementation?
>>>
>>> Andreas
>>>
>>> On 29 juin 08, at 16:47, Hiranya Jayathilaka wrote:
>>>
>>>> Hi Devs,
>>>>
>>>> Can we access the information like target address endpoints, we 
>>>> normally put in the synapse configuration, at the transport level 
>>>> (at a transport listener to be precise)? I want to read the target 
>>>> address of a proxy service at the transport level. This is required 
>>>> to resolve SYNAPSE-380. I have access to the configuration context 
>>>> and the AxisService object of the proxy service.
>>>>
>>>> Thanks in advance
>>>>
>>>> Best Regards,
>>>> Hiranya Jayathilaka
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> -- 
>> Asankha C. Perera
>>
>> WSO2 - http://wso2.org
>> http://esbmagic.blogspot.com
>>
>

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: Reading Target Address Parameter at Transport Level

Posted by Asanka Abeysinghe <as...@wso2.com>.
That will be based on the size and the number of derivatives (equity, 
options, bonds, forex etc)  handle by the  user.  A small  broker  
dealer  will  use one FIX session (that connects with a FIX gateway or 
an Order Router), but a large firm might use multiple sessions to 
connect with different markets and handle different derivatives.
Asanka A.

Asankha C. Perera wrote:
> Around how many of these "sessions" will a typical usecase have? in 
> the order of services deployed, or a small fixed number - like the JMS 
> connection factories? If this is a small fixed number, you could 
> define this similarly to the way the JMS sender defines connection pools
>
> asankha
>
>


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


Re: Reading Target Address Parameter at Transport Level

Posted by Asanka Abeysinghe <as...@wso2.com>.
Hiranya Jayathilaka wrote:
>
> In the current FIX transport impl we don't have to define any 
> synapse.initiator parameters defined in the FIX URL again in the file 
> pointed to by the transport.fix.InitiatorConfigURL. What you are 
> suggesting is to define all the parameters defined in the URL again in 
> the initiator config file and use that file at the start up to create 
> the session. Am I correct?
>
> If this is what you mean I'm +1 for the solution. Will require some 
> documentation changes though.
>
Yes , because we have only two options
[1] Read all the synapse.initiator FIX endpoints in the synapse.xml and 
construct the QFJ session config file and handover the session 
generation process to QFJ - that we do have technical limitations
[2] Define the sessions in the QFJ session config file and use the 
Session string (as a URL) in the address of the endpoint definition - 
what we discussed above

I do have a proposal for future (that we can implement in a next 
version) to use the "session qualifier" of QFJ and give the option for 
the user to use the session qualifier or the current session string (URL 
as we call now) in the address endpoint.eg  fix://<session Qualifier>, 
that will avoid duplicating the session info in two places.
Asanka A.

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


Re: Reading Target Address Parameter at Transport Level

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi,

On Tue, Jul 1, 2008 at 12:04 AM, Asanka Abeysinghe <as...@wso2.com> wrote:

> +1
> Content used in the address of a FIX endpoint is not a typical URL, it
> contains  information  to  create  a  FIX  session.
>
> A FIX session is an connection between two TCP/IP sockets that transport
> messages using asynchronous  network  I/O.  Once  a  session  starts  it
>  keeps  live  by sending  heartbeats  followed by session level  test
> messages  between  the  two  FIX engines  connected  together.
>
> So the URL used in the address of the FIX endpoint is a reference to a FIX
> session.
> As Asankha mentioned we can used the slimier approach to like the JMS impl,
> how it mapped it to a FIX impl is as follows.
> - Define all the synapse.initiator (that connect to the acceptor endpoint)
> FIX session inside the synapse.initiator FIX configuration file. (identified
> by the parameter 'transport.fix.InitiatorConfigURL')


In the current FIX transport impl we don't have to define any
synapse.initiator parameters defined in the FIX URL again in the file
pointed to by the transport.fix.InitiatorConfigURL. What you are suggesting
is to define all the parameters defined in the URL again in the initiator
config file and use that file at the start up to create the session. Am I
correct?

If this is what you mean I'm +1 for the solution. Will require some
documentation changes though.


> - Start the  FIX engine for synapse.initiator in the start-up as it does
> for synapse.acceptor session(s)
> - Keep the created/active sessions in a data structure (identified when the
> 'onCreate' callback get fired)


We already have the necessary infrastructure for this. So not a problem

Thanks

Best Regards,
Hiranya Jayathilaka


>   we might have to keep two data structures 1) session string| session id
> 2) session id | QFJ session object and do a re-hash
> - Use the current FIX URL to send messages
> - Check the session availability by using the  URL  string  or  create  a
>  new  session - Let the QFJ to dispatch the message using the correct
> session
>
> Asanka  A.
>
> Asankha C. Perera wrote:
>
>> Andreas Veithen wrote:
>>
>>> There is an alternative to all this:
>>>
>>> 1. Create an implementation of the Startup interface together with a
>>> StartupFactory and StartupSerializer.
>>> 2. When the init method (defined by ManagedLifecycle) is called on the
>>> Startup (at Synapse startup as the name implies), it gets the
>>> SynapseEnvironment as parameter. From there you can get access to the
>>> SynapseConfiguration and the Axis2 ConfigurationContext (provided that
>>> SYNAPSE-382 is fixed).
>>> 3. SynapseConfiguration#getProxyServices gives you the list of defined
>>> proxy services and ProxyService#getTargetEndpoint gives you the target
>>> endpoint.
>>> 4. ConfigurationContext#getAxisConfiguration gives you the
>>> AxisConfiguration and from there you can locate a transport sender by using
>>> AxisConfiguration#getTransport(s)(In|Out) (call get(Reveiver|Sender) on the
>>> Transport(In|Out)Description).
>>>
>>> This should give you all the information you need to access the transport
>>> and tell it to start the relevant sessions.
>>>
>> But this would make this Synapse specific with a startup class
>> involvement? Also this will prevent JMX access from starting and stopping
>> the transports cleanly as the startup is involved.. I think the transports
>> should be handled behind the transport abstraction, without mixing it with
>> Synapse.., and this is possible as I understand, using the same way the JMS
>> sender operates
>>
>> I discussed this with Asanka A. who raised this original question and he
>> agreed that what we have for the JMS sender is what they need. I do not
>> understand FIX or the transport/implementation much, but AFAIK what they
>> mean as the "URL" here is not what others seems to think.. Asanka A - if you
>> agree with me, could you please reply to this list if what I suggest is an
>> appropriate approach, else please tell me why it will not work?
>>
>> asankha
>>
>> --
>> Asankha C. Perera
>>
>> WSO2 - http://wso2.org
>> http://esbmagic.blogspot.com
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>

Re: Reading Target Address Parameter at Transport Level

Posted by Asanka Abeysinghe <as...@wso2.com>.
+1
Content used in the address of a FIX endpoint is not a typical URL, it 
contains  information  to  create  a  FIX  session.

A FIX session is an connection between two TCP/IP sockets that transport 
messages using asynchronous  network  I/O.  Once  a  session  starts  
it  keeps  live  by sending  heartbeats  followed by session level  test 
messages  between  the  two  FIX engines  connected  together.

So the URL used in the address of the FIX endpoint is a reference to a 
FIX session.  

As Asankha mentioned we can used the slimier approach to like the JMS 
impl, how it mapped it to a FIX impl is as follows.
- Define all the synapse.initiator (that connect to the acceptor 
endpoint) FIX session inside the synapse.initiator FIX configuration 
file. (identified by the parameter 'transport.fix.InitiatorConfigURL')
- Start the  FIX engine for synapse.initiator in the start-up as it does 
for synapse.acceptor session(s)
- Keep the created/active sessions in a data structure (identified when 
the 'onCreate' callback get fired)
    we might have to keep two data structures 1) session string| session 
id 2) session id | QFJ session object and do a re-hash
- Use the current FIX URL to send messages
- Check the session availability by using the  URL  string  or  create  
a  new  session 
- Let the QFJ to dispatch the message using the correct session

Asanka  A.
 
Asankha C. Perera wrote:
> Andreas Veithen wrote:
>> There is an alternative to all this:
>>
>> 1. Create an implementation of the Startup interface together with a 
>> StartupFactory and StartupSerializer.
>> 2. When the init method (defined by ManagedLifecycle) is called on 
>> the Startup (at Synapse startup as the name implies), it gets the 
>> SynapseEnvironment as parameter. From there you can get access to the 
>> SynapseConfiguration and the Axis2 ConfigurationContext (provided 
>> that SYNAPSE-382 is fixed).
>> 3. SynapseConfiguration#getProxyServices gives you the list of 
>> defined proxy services and ProxyService#getTargetEndpoint gives you 
>> the target endpoint.
>> 4. ConfigurationContext#getAxisConfiguration gives you the 
>> AxisConfiguration and from there you can locate a transport sender by 
>> using AxisConfiguration#getTransport(s)(In|Out) (call 
>> get(Reveiver|Sender) on the Transport(In|Out)Description).
>>
>> This should give you all the information you need to access the 
>> transport and tell it to start the relevant sessions.
> But this would make this Synapse specific with a startup class 
> involvement? Also this will prevent JMX access from starting and 
> stopping the transports cleanly as the startup is involved.. I think 
> the transports should be handled behind the transport abstraction, 
> without mixing it with Synapse.., and this is possible as I 
> understand, using the same way the JMS sender operates
>
> I discussed this with Asanka A. who raised this original question and 
> he agreed that what we have for the JMS sender is what they need. I do 
> not understand FIX or the transport/implementation much, but AFAIK 
> what they mean as the "URL" here is not what others seems to think.. 
> Asanka A - if you agree with me, could you please reply to this list 
> if what I suggest is an appropriate approach, else please tell me why 
> it will not work?
>
> asankha
>
> -- 
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>


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


Re: Reading Target Address Parameter at Transport Level

Posted by Ruwan Linton <ru...@gmail.com>.
I too think it is better if we can solve this without getting hands on to
the Startup tasks.

+1 for following the same approach followed by the JMSSender

Thanks,
Ruwan

On Mon, Jun 30, 2008 at 10:53 PM, Asankha C. Perera <as...@wso2.com>
wrote:

>  Andreas Veithen wrote:
>
> There is an alternative to all this:
>
> 1. Create an implementation of the Startup interface together with a
> StartupFactory and StartupSerializer.
> 2. When the init method (defined by ManagedLifecycle) is called on the
> Startup (at Synapse startup as the name implies), it gets the
> SynapseEnvironment as parameter. From there you can get access to the
> SynapseConfiguration and the Axis2 ConfigurationContext (provided that
> SYNAPSE-382 is fixed).
> 3. SynapseConfiguration#getProxyServices gives you the list of defined
> proxy services and ProxyService#getTargetEndpoint gives you the target
> endpoint.
> 4. ConfigurationContext#getAxisConfiguration gives you the
> AxisConfiguration and from there you can locate a transport sender by using
> AxisConfiguration#getTransport(s)(In|Out) (call get(Reveiver|Sender) on the
> Transport(In|Out)Description).
>
> This should give you all the information you need to access the transport
> and tell it to start the relevant sessions.
>
> But this would make this Synapse specific with a startup class involvement?
> Also this will prevent JMX access from starting and stopping the transports
> cleanly as the startup is involved.. I think the transports should be
> handled behind the transport abstraction, without mixing it with Synapse..,
> and this is possible as I understand, using the same way the JMS sender
> operates
>
> I discussed this with Asanka A. who raised this original question and he
> agreed that what we have for the JMS sender is what they need. I do not
> understand FIX or the transport/implementation much, but AFAIK what they
> mean as the "URL" here is not what others seems to think.. Asanka A - if you
> agree with me, could you please reply to this list if what I suggest is an
> appropriate approach, else please tell me why it will not work?
>
> asankha
>
> --
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>
>


-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/

Re: Reading Target Address Parameter at Transport Level

Posted by "Asankha C. Perera" <as...@wso2.com>.
Andreas Veithen wrote:
> There is an alternative to all this:
>
> 1. Create an implementation of the Startup interface together with a 
> StartupFactory and StartupSerializer.
> 2. When the init method (defined by ManagedLifecycle) is called on the 
> Startup (at Synapse startup as the name implies), it gets the 
> SynapseEnvironment as parameter. From there you can get access to the 
> SynapseConfiguration and the Axis2 ConfigurationContext (provided that 
> SYNAPSE-382 is fixed).
> 3. SynapseConfiguration#getProxyServices gives you the list of defined 
> proxy services and ProxyService#getTargetEndpoint gives you the target 
> endpoint.
> 4. ConfigurationContext#getAxisConfiguration gives you the 
> AxisConfiguration and from there you can locate a transport sender by 
> using AxisConfiguration#getTransport(s)(In|Out) (call 
> get(Reveiver|Sender) on the Transport(In|Out)Description).
>
> This should give you all the information you need to access the 
> transport and tell it to start the relevant sessions.
But this would make this Synapse specific with a startup class 
involvement? Also this will prevent JMX access from starting and 
stopping the transports cleanly as the startup is involved.. I think the 
transports should be handled behind the transport abstraction, without 
mixing it with Synapse.., and this is possible as I understand, using 
the same way the JMS sender operates

I discussed this with Asanka A. who raised this original question and he 
agreed that what we have for the JMS sender is what they need. I do not 
understand FIX or the transport/implementation much, but AFAIK what they 
mean as the "URL" here is not what others seems to think.. Asanka A - if 
you agree with me, could you please reply to this list if what I suggest 
is an appropriate approach, else please tell me why it will not work?

asankha

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: Reading Target Address Parameter at Transport Level

Posted by Paul Fremantle <pz...@gmail.com>.
Nice!

Paul

On Mon, Jun 30, 2008 at 6:08 PM, Andreas Veithen
<an...@skynet.be> wrote:
> There is an alternative to all this:
>
> 1. Create an implementation of the Startup interface together with a
> StartupFactory and StartupSerializer.
> 2. When the init method (defined by ManagedLifecycle) is called on the
> Startup (at Synapse startup as the name implies), it gets the
> SynapseEnvironment as parameter. From there you can get access to the
> SynapseConfiguration and the Axis2 ConfigurationContext (provided that
> SYNAPSE-382 is fixed).
> 3. SynapseConfiguration#getProxyServices gives you the list of defined proxy
> services and ProxyService#getTargetEndpoint gives you the target endpoint.
> 4. ConfigurationContext#getAxisConfiguration gives you the AxisConfiguration
> and from there you can locate a transport sender by using
> AxisConfiguration#getTransport(s)(In|Out) (call get(Reveiver|Sender) on the
> Transport(In|Out)Description).
>
> This should give you all the information you need to access the transport
> and tell it to start the relevant sessions.
>
> Andreas
>
> On 30 juin 08, at 13:58, Hiranya Jayathilaka wrote:
>
>> Hi,
>>
>> On Mon, Jun 30, 2008 at 11:24 AM, Asanka Abeysinghe <as...@wso2.com>
>> wrote:
>> I totally agree with Asankha to take a similar approach like JMS
>> connection pools. Even FIX transport does the same to create the
>> ***Initiator*** session(s) by starting the FIX engine inside
>> 'startListerningForServices' method in the FIX transport listener.  So  if
>> we start the ***Acceptor** *FIX Engine by providing the session(s) info at
>> the same level we will solving our problem. when message transports it will
>> check the availability of the session and if exists use the session and
>> dispatch the message else create a new session (as it is  now) .
>>
>> Currently we read  a service parameter (transport.fix.AccetorConfigURL)
>> inside the startListeningForService method and create the acceptors as
>> necessary. If we are to do the same for creating initiators we will have to
>> introduce a new parameter and ask the user to specify the target URL in that
>> parameter in addition to in the target element of the service definition.
>> But this approach suffers the drawback I mentioned previously. That is with
>> one parameter we can specify only one target URL. Then we will be able to
>> create only one acceptor session at the start up. If there's a way we can
>> specify multiple URL values with one parameter then implementing the rest is
>> easy.
>>
>> Any Ideas?
>>
>> Thanks
>>
>> Best Regards,
>> Hiranya
>>
>> Asanka A.
>>
>> Asankha C. Perera wrote:
>> Asanka
>> Primary reason is that and I can add few more use cases
>> 1. Acceptor can send messages for a specific session before sending
>> messages from the initiator (fills, corrections and acknowledgments for the
>> previously posted transactions).
>> 2. FIX recovery happens with the session creation, so with the current
>> implementation recovery has to wait till the first message sends.
>>
>> Around how many of these "sessions" will a typical usecase have? in the
>> order of services deployed, or a small fixed number - like the JMS
>> connection factories? If this is a small fixed number, you could define this
>> similarly to the way the JMS sender defines connection pools
>>
>>
>>
>> ---------------------------------------------------------------------
>>
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>



-- 
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


Re: Reading Target Address Parameter at Transport Level

Posted by Andreas Veithen <an...@skynet.be>.
There is an alternative to all this:

1. Create an implementation of the Startup interface together with a  
StartupFactory and StartupSerializer.
2. When the init method (defined by ManagedLifecycle) is called on the  
Startup (at Synapse startup as the name implies), it gets the  
SynapseEnvironment as parameter. From there you can get access to the  
SynapseConfiguration and the Axis2 ConfigurationContext (provided that  
SYNAPSE-382 is fixed).
3. SynapseConfiguration#getProxyServices gives you the list of defined  
proxy services and ProxyService#getTargetEndpoint gives you the target  
endpoint.
4. ConfigurationContext#getAxisConfiguration gives you the  
AxisConfiguration and from there you can locate a transport sender by  
using AxisConfiguration#getTransport(s)(In|Out) (call get(Reveiver| 
Sender) on the Transport(In|Out)Description).

This should give you all the information you need to access the  
transport and tell it to start the relevant sessions.

Andreas

On 30 juin 08, at 13:58, Hiranya Jayathilaka wrote:

> Hi,
>
> On Mon, Jun 30, 2008 at 11:24 AM, Asanka Abeysinghe  
> <as...@wso2.com> wrote:
> I totally agree with Asankha to take a similar approach like JMS  
> connection pools. Even FIX transport does the same to create the  
> ***Initiator*** session(s) by starting the FIX engine inside  
> 'startListerningForServices' method in the FIX transport listener.   
> So  if we start the ***Acceptor** *FIX Engine by providing the  
> session(s) info at the same level we will solving our problem. when  
> message transports it will check the availability of the session and  
> if exists use the session and dispatch the message else create a new  
> session (as it is  now) .
>
> Currently we read  a service parameter  
> (transport.fix.AccetorConfigURL) inside the startListeningForService  
> method and create the acceptors as necessary. If we are to do the  
> same for creating initiators we will have to introduce a new  
> parameter and ask the user to specify the target URL in that  
> parameter in addition to in the target element of the service  
> definition. But this approach suffers the drawback I mentioned  
> previously. That is with one parameter we can specify only one  
> target URL. Then we will be able to create only one acceptor session  
> at the start up. If there's a way we can specify multiple URL values  
> with one parameter then implementing the rest is easy.
>
> Any Ideas?
>
> Thanks
>
> Best Regards,
> Hiranya
>
> Asanka A.
>
> Asankha C. Perera wrote:
> Asanka
> Primary reason is that and I can add few more use cases
> 1. Acceptor can send messages for a specific session before sending  
> messages from the initiator (fills, corrections and acknowledgments  
> for the previously posted transactions).
> 2. FIX recovery happens with the session creation, so with the  
> current implementation recovery has to wait till the first message  
> sends.
>
> Around how many of these "sessions" will a typical usecase have? in  
> the order of services deployed, or a small fixed number - like the  
> JMS connection factories? If this is a small fixed number, you could  
> define this similarly to the way the JMS sender defines connection  
> pools
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


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


Re: Reading Target Address Parameter at Transport Level

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi,

On Mon, Jun 30, 2008 at 11:24 AM, Asanka Abeysinghe <as...@wso2.com>
wrote:

> I totally agree with Asankha to take a similar approach like JMS connection
> pools. Even FIX transport does the same to create the ***Initiator***
> session(s) by starting the FIX engine inside 'startListerningForServices'
> method in the FIX transport listener.  So  if we start the ***Acceptor**
> *FIX Engine by providing the session(s) info at the same level we will
> solving our problem. when message transports it will check the availability
> of the session and if exists use the session and dispatch the message else
> create a new session (as it is  now) .


Currently we read  a service parameter (transport.fix.AccetorConfigURL)
inside the startListeningForService method and create the acceptors as
necessary. If we are to do the same for creating initiators we will have to
introduce a new parameter and ask the user to specify the target URL in that
parameter in addition to in the target element of the service definition.
But this approach suffers the drawback I mentioned previously. That is with
one parameter we can specify only one target URL. Then we will be able to
create only one acceptor session at the start up. If there's a way we can
specify multiple URL values with one parameter then implementing the rest is
easy.

Any Ideas?

Thanks

Best Regards,
Hiranya

>
> Asanka A.
>
> Asankha C. Perera wrote:
>
>> Asanka
>>
>>> Primary reason is that and I can add few more use cases
>>> 1. Acceptor can send messages for a specific session before sending
>>> messages from the initiator (fills, corrections and acknowledgments for the
>>> previously posted transactions).
>>> 2. FIX recovery happens with the session creation, so with the current
>>> implementation recovery has to wait till the first message sends.
>>>
>>>  Around how many of these "sessions" will a typical usecase have? in the
>> order of services deployed, or a small fixed number - like the JMS
>> connection factories? If this is a small fixed number, you could define this
>> similarly to the way the JMS sender defines connection pools
>>
>>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>

Re: Reading Target Address Parameter at Transport Level

Posted by Asanka Abeysinghe <as...@wso2.com>.
I totally agree with Asankha to take a similar approach like JMS 
connection pools. Even FIX transport does the same to create the 
***Initiator*** session(s) by starting the FIX engine inside 
'startListerningForServices' method in the FIX transport listener.  So  
if we start the ***Acceptor** *FIX Engine by providing the session(s) 
info at the same level we will solving our problem. when message 
transports it will check the availability of the session and if exists 
use the session and dispatch the message else create a new session (as 
it is  now) .
Asanka A.

Asankha C. Perera wrote:
> Asanka
>> Primary reason is that and I can add few more use cases
>> 1. Acceptor can send messages for a specific session before sending 
>> messages from the initiator (fills, corrections and acknowledgments 
>> for the previously posted transactions).
>> 2. FIX recovery happens with the session creation, so with the 
>> current implementation recovery has to wait till the first message 
>> sends.
>>
> Around how many of these "sessions" will a typical usecase have? in 
> the order of services deployed, or a small fixed number - like the JMS 
> connection factories? If this is a small fixed number, you could 
> define this similarly to the way the JMS sender defines connection pools
>


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


Re: Reading Target Address Parameter at Transport Level

Posted by "Asankha C. Perera" <as...@wso2.com>.
Asanka
> Primary reason is that and I can add few more use cases
> 1. Acceptor can send messages for a specific session before sending 
> messages from the initiator (fills, corrections and acknowledgments 
> for the previously posted transactions).
> 2. FIX recovery happens with the session creation, so with the current 
> implementation recovery has to wait till the first message sends.
>
Around how many of these "sessions" will a typical usecase have? in the 
order of services deployed, or a small fixed number - like the JMS 
connection factories? If this is a small fixed number, you could define 
this similarly to the way the JMS sender defines connection pools

asankha
> Andreas Veithen wrote:
>> As far as I understand the requirement is as follows: When the 
>> transport sender transmits the first message to a given endpoint, it 
>> needs to create a session with the endpoint. This operation is 
>> expensive and causes a delay if the message is received and forwarded 
>> by a proxy service. Since Synapse knows about the endpoints it will 
>> connect to, the idea is to create these sessions in advance (at 
>> startup) so that the proxy service will forward the first message 
>> without delay. However the transports can't get access to the 
>> required information because it is managed by Synapse specific classes.
>>
>> On 29 juin 08, at 18:15, Asankha C. Perera wrote:
>>
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: Reading Target Address Parameter at Transport Level

Posted by Asanka Abeysinghe <as...@wso2.com>.
Yes, Andreas definition is correct. Detail information can find from the 
thread [1].

Primary reason is that and I can add few more use cases
1. Acceptor can send messages for a specific session before sending 
messages from the initiator (fills, corrections and acknowledgments for 
the previously posted transactions).
2. FIX recovery happens with the session creation, so with the current 
implementation recovery has to wait till the first message sends.

Asanka A.
[1] 
http://mail-archives.apache.org/mod_mbox/synapse-dev/200806.mbox/%3c48647C09.4070408@wso2.com%3e

Andreas Veithen wrote:
> As far as I understand the requirement is as follows: When the 
> transport sender transmits the first message to a given endpoint, it 
> needs to create a session with the endpoint. This operation is 
> expensive and causes a delay if the message is received and forwarded 
> by a proxy service. Since Synapse knows about the endpoints it will 
> connect to, the idea is to create these sessions in advance (at 
> startup) so that the proxy service will forward the first message 
> without delay. However the transports can't get access to the required 
> information because it is managed by Synapse specific classes.
>
> On 29 juin 08, at 18:15, Asankha C. Perera wrote:
>
>>
>>


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


Re: Reading Target Address Parameter at Transport Level

Posted by indika kumara <in...@gmail.com>.
Hi All

Can we do this with observer/observable patterns . can't we ?. I feel we
can.....For example, we can notify registered observers  with the required
data after started up synapse completely (As a final step). Data may
included synapse configuration , in this case ,some data to get transport
listers. Then, within observer implementation,get the transport listener
instance(in this case FIX) and synapse configuration and give synapse
configuration to FIX listener to do whatever it want.

Just a idea... I don't how it will be valuable.

Thanks
Indika

Re: Reading Target Address Parameter at Transport Level

Posted by Andreas Veithen <an...@skynet.be>.
As far as I understand the requirement is as follows: When the  
transport sender transmits the first message to a given endpoint, it  
needs to create a session with the endpoint. This operation is  
expensive and causes a delay if the message is received and forwarded  
by a proxy service. Since Synapse knows about the endpoints it will  
connect to, the idea is to create these sessions in advance (at  
startup) so that the proxy service will forward the first message  
without delay. However the transports can't get access to the required  
information because it is managed by Synapse specific classes.

On 29 juin 08, at 18:15, Asankha C. Perera wrote:

> Hiranya
>
> The description of the issue does not make me understand much about  
> the underlying problem, but some transports like JMS, Mail, VFS etc,  
> will only poll/connect on behalf of services that registers with  
> them. So, you can get the service.xml parameters (or Proxy service  
> parameters), from the AxisService, and there you could define what  
> you want for the transport. This will not make the transport Synapse  
> specific, as Axis2 can work too
>
> hope this helps
> asankha
>
> Andreas Veithen wrote:
>>
>> Transports should not contain any code specific to Synapse. Maybe  
>> you can achieve your goal by creating a org.apache.synapse.Startup  
>> implementation?
>>
>> Andreas
>>
>> On 29 juin 08, at 16:47, Hiranya Jayathilaka wrote:
>>
>>> Hi Devs,
>>>
>>> Can we access the information like target address endpoints, we  
>>> normally put in the synapse configuration, at the transport level  
>>> (at a transport listener to be precise)? I want to read the target  
>>> address of a proxy service at the transport level. This is  
>>> required to resolve SYNAPSE-380. I have access to the  
>>> configuration context and the AxisService object of the proxy  
>>> service.
>>>
>>> Thanks in advance
>>>
>>> Best Regards,
>>> Hiranya Jayathilaka
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
> -- 
> Asankha C. Perera
>
> WSO2 - http://wso2.org
> http://esbmagic.blogspot.com
>


Re: Reading Target Address Parameter at Transport Level

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hiranya

The description of the issue does not make me understand much about the 
underlying problem, but some transports like JMS, Mail, VFS etc, will 
only poll/connect on behalf of services that registers with them. So, 
you can get the service.xml parameters (or Proxy service parameters), 
from the AxisService, and there you could define what you want for the 
transport. This will not make the transport Synapse specific, as Axis2 
can work too

hope this helps
asankha

Andreas Veithen wrote:
> Transports should not contain any code specific to Synapse. Maybe you 
> can achieve your goal by creating a org.apache.synapse.Startup 
> implementation?
>
> Andreas
>
> On 29 juin 08, at 16:47, Hiranya Jayathilaka wrote:
>
>> Hi Devs,
>>
>> Can we access the information like target address endpoints, we 
>> normally put in the synapse configuration, at the transport level (at 
>> a transport listener to be precise)? I want to read the target 
>> address of a proxy service at the transport level. This is required 
>> to resolve SYNAPSE-380. I have access to the configuration context 
>> and the AxisService object of the proxy service.
>>
>> Thanks in advance
>>
>> Best Regards,
>> Hiranya Jayathilaka
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: Reading Target Address Parameter at Transport Level

Posted by Andreas Veithen <an...@skynet.be>.
Transports should not contain any code specific to Synapse. Maybe you  
can achieve your goal by creating a org.apache.synapse.Startup  
implementation?

Andreas

On 29 juin 08, at 16:47, Hiranya Jayathilaka wrote:

> Hi Devs,
>
> Can we access the information like target address endpoints, we  
> normally put in the synapse configuration, at the transport level  
> (at a transport listener to be precise)? I want to read the target  
> address of a proxy service at the transport level. This is required  
> to resolve SYNAPSE-380. I have access to the configuration context  
> and the AxisService object of the proxy service.
>
> Thanks in advance
>
> Best Regards,
> Hiranya Jayathilaka


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