You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Ali Sadik Kumlali <as...@yahoo.com> on 2006/11/02 10:43:41 UTC

[Axis2][1.1 Nightly] Why a JMS destination should be dedicated to only a single service (and vice-versa)?

Hi all,

Sorry for this long message :)

Nowadays, I'm trying to dispatch messages come through different destinations to a single service.  However, current JMS implemantation enforces a one-to-one relationship between service and the destination. Thus, the following operations is not allowed:
- A single destination can be used for messages of different services
- Multiple destinations can be used for messages of the same service

By looking at the implemantation, I've seen that is because of the difficulties of dispatching when it comes to JMS. Destination-service relation is established in services.xml and dispatching is done according to this relation. That is, when a JMS message comes in, service of the destination is set to the MC and no dispatching is done for service discovery. Later, SOAPActionBasedDispatcher is used to get the operation.

Actually, I feel that the transport and/or dispatching related definition should not be reside in services.xml. And, I believe, this unique behaviour of JMS tranport is inconsistent with the implementations of other transports. 

So, I've been searching a better way for dispatching JMS messages without that restriction. 

When I look at more deeply, I see that RequestURIBasedDispatcher is not capable of dispatching JMS messages, since we don't have "to" field in MC. If, somehow, we were able to pass JMS URL to "to" field, RequestURIBasedDispatcher would not be sufficient to understand JMS URL.

Ok. What about SOAPActionBasedDispatcher? Can I use it for finding my service, based on the SOAPAction? Nope. Because, it is not implemented yet. And I'm not sure how it would be possible to discover the service from the SOAPAction. Iterate over the deployed services and lookup the operation for each service? If yes, what would happen if two services had the same SOAPAction? Choose the first matching one? :)

After RequestURIBasedDispatcher and SOAPActionBasedDispatcher is passed, I still don't have either service or operation in MC. Then I enter the Security phase where I'm asked for service name, and of course, a NPE is thrown :)

Does it make sense to enter AddressingBasedDispatcher before entering Security phase? Nope, because of the same thing happens in RequestURIBasedDispatcher: I don't have "to" field in MC.

OK. Can I use SOAPMessageBodyBasedDispatcher? Nope, because;
  - messageContext.getConfigurationContext().getServiceContextPath(): axis2/services
  - namespace of the first element(filePart): http://ws.mycompany.com/schemas/account_1_0
  - Utils.parseRequestURLForServiceAndOperation() returns no service and operation

Then, what would be the possible solution? 
- At sender side:
   - Adding service name to the JMS URL
   - Adding service name to the JMS message header before sending it (the same approach used for transferring SOAPAction)
- At receiver side:
  - Setting "to" field of the MC to the value of service name field retrieved from JMS message header.
  - Setting "soapAction" field of the MC to the value of SOAPAction field retrieved from JMS message header (this is already done with the current implementation).
  - Letting SOAPActionBasedDispatcher to find the operation by using soapAction value in MC (this is already done with the current implementation). 

All the transports send service name (and operation name) with the request, but JMS. Please look at the following EPRs:
- HTTP: http://127.0.0.1:8080/axis2/services/EchoXMLService/echoOMElement
- SMTP: mail:foo@127.0.0.1/axis2/services/EchoXMLService/echoOMElement
- TCP: tcp://127.0.0.1:8080/axis2/services/EchoXMLService/echoOMElement
- JMS: jms:/destinationName?transport.jms.ConnectionFactoryJNDIName=conFactName&...

By sending service name with the JMS request, we would;
- be more consistent
- not need service-destination mapping in services.xml
- use a single destination for multiple services
- dispatch messages come from different destionations to the same service

Any thoughts?

Regards,

Ali Sadik Kumlali





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


Re: [Axis2][1.1 Nightly] Why a JMS destination should be dedicated to only a single service (and vice-versa)?

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

I agree with your suggestion on including the service name in the EPR, 
and in-fact this is would be done when we standardize our SOAP/JMS 
implementation in the near future to be compatible with similar 
implementations. The proposed standardization would also address your 
concerns on specifying the destination in the services XML. I will let 
you know more details on this as soon as it becomes available - but 
immediate implementation of it is not currently planned. I need to look 
at our current code to decide how we could support your requirements for 
the following, but at this point, I think both would be possible with 
some changes.
> - A single destination can be used for messages of different services
> - Multiple destinations can be used for messages of the same service
>   
asankha


Ali Sadik Kumlali wrote:
> Hi all,
>
> Sorry for this long message :)
>
> Nowadays, I'm trying to dispatch messages come through different destinations to a single service.  However, current JMS implemantation enforces a one-to-one relationship between service and the destination. Thus, the following operations is not allowed:
> - A single destination can be used for messages of different services
> - Multiple destinations can be used for messages of the same service
>
> By looking at the implemantation, I've seen that is because of the difficulties of dispatching when it comes to JMS. Destination-service relation is established in services.xml and dispatching is done according to this relation. That is, when a JMS message comes in, service of the destination is set to the MC and no dispatching is done for service discovery. Later, SOAPActionBasedDispatcher is used to get the operation.
>
> Actually, I feel that the transport and/or dispatching related definition should not be reside in services.xml. And, I believe, this unique behaviour of JMS tranport is inconsistent with the implementations of other transports. 
>
> So, I've been searching a better way for dispatching JMS messages without that restriction. 
>
> When I look at more deeply, I see that RequestURIBasedDispatcher is not capable of dispatching JMS messages, since we don't have "to" field in MC. If, somehow, we were able to pass JMS URL to "to" field, RequestURIBasedDispatcher would not be sufficient to understand JMS URL.
>
> Ok. What about SOAPActionBasedDispatcher? Can I use it for finding my service, based on the SOAPAction? Nope. Because, it is not implemented yet. And I'm not sure how it would be possible to discover the service from the SOAPAction. Iterate over the deployed services and lookup the operation for each service? If yes, what would happen if two services had the same SOAPAction? Choose the first matching one? :)
>
> After RequestURIBasedDispatcher and SOAPActionBasedDispatcher is passed, I still don't have either service or operation in MC. Then I enter the Security phase where I'm asked for service name, and of course, a NPE is thrown :)
>
> Does it make sense to enter AddressingBasedDispatcher before entering Security phase? Nope, because of the same thing happens in RequestURIBasedDispatcher: I don't have "to" field in MC.
>
> OK. Can I use SOAPMessageBodyBasedDispatcher? Nope, because;
>   - messageContext.getConfigurationContext().getServiceContextPath(): axis2/services
>   - namespace of the first element(filePart): http://ws.mycompany.com/schemas/account_1_0
>   - Utils.parseRequestURLForServiceAndOperation() returns no service and operation
>
> Then, what would be the possible solution? 
> - At sender side:
>    - Adding service name to the JMS URL
>    - Adding service name to the JMS message header before sending it (the same approach used for transferring SOAPAction)
> - At receiver side:
>   - Setting "to" field of the MC to the value of service name field retrieved from JMS message header.
>   - Setting "soapAction" field of the MC to the value of SOAPAction field retrieved from JMS message header (this is already done with the current implementation).
>   - Letting SOAPActionBasedDispatcher to find the operation by using soapAction value in MC (this is already done with the current implementation). 
>
> All the transports send service name (and operation name) with the request, but JMS. Please look at the following EPRs:
> - HTTP: http://127.0.0.1:8080/axis2/services/EchoXMLService/echoOMElement
> - SMTP: mail:foo@127.0.0.1/axis2/services/EchoXMLService/echoOMElement
> - TCP: tcp://127.0.0.1:8080/axis2/services/EchoXMLService/echoOMElement
> - JMS: jms:/destinationName?transport.jms.ConnectionFactoryJNDIName=conFactName&...
>
> By sending service name with the JMS request, we would;
> - be more consistent
> - not need service-destination mapping in services.xml
> - use a single destination for multiple services
> - dispatch messages come from different destionations to the same service
>
> Any thoughts?
>
> Regards,
>
> Ali Sadik Kumlali
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>
>
>   

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