You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Paul Wilton <Pa...@bbc.com> on 2009/10/05 17:54:04 UTC

JMS transport for JAX-RS

Hi

Is it possible to use a JMS Transport for JAX-RS (JSR-311) web service
endpoint ?

I'm interested in implementing an ATOM consumer service using abdera
(AtomEntryProvider), for both HTTP (RESTful) and JMS (topic
subscription) transports.

 

Thanks

Paul 
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
 
Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this

This e-mail has been sent by one of the following wholly-owned subsidiaries of the BBC:
 
BBC Worldwide Limited, Registration Number: 1420028 England, Registered Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ
BBC World News Limited, Registration Number: 04514407 England, Registered Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ
BBC World Distribution Limited, Registration Number: 04514408, Registered Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ

Re: JMS transport for JAX-RS

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi Paul

I have just committed the initial code to trunk/2.2.x-SNAPSHOT. Please see [1], [2], [3].

What is there now should probably work for most of the cases (topics/queues, including the JMS transactions support). Transactions 
will work if custom exceptions have not been caught by JAXRS mappers (won't be an issue once the JAXRS exception mapping code is 
moved into fault interceptors). The remaining work will have to do with some internal cleanup (ex, CXF JAXRS uses HttpUtils to get 
protocol headers which might've come over JMS). Plus possibly coming up with better JMS property names (see [1]). I'll also add a 
custom context later on called ProtocolHeaders which will just reuse HttpHeadersImpl imternally, using ProtocolHeaders will give the 
code which needs the headers a more transprot-neutral code.

here're some comments regarding [1] and [2].
- you only need to add a transportId to a given jaxrs endpoint, thus you can have the same bean getting data over different channels 
(http/jms) by referencing it from say 2 endpoints.
- check a jaxrs:server/serviceName attribute - you don't have to use but this is how you can nominate a service name for a jaxrs 
endpoint, default is {http://reverse.package.name}ServiceClassName
- see how a jms destination is configured, it uses queues, but topics can also be configured. See [4] for more details

here're JMS properties which can help with matching a required method :
- "Content-Type" : default is "text/xml"
- "Accept" : default is "*/*"
- "OnewayMessage" : default is "false", that is a JMSReplyTo proeprty has to be set on the incoming message if "OnewayMessage" is 
not set or false
- "org.apache.cxf.message.Message.REQUEST_URI" : default is "/"
- "org.apache.cxf.message.Message.HTTP_REQUEST_METHOD" : default is "POST"

as far as REQUEST_URI is concerned, it is initially matched against a jaxrs:server/@address.
So if REQUEST_URI is not set or set to "/" then jaxrs:server/@address has to be set to "/". If REQUEST_URI is set to "/bar/foo" and 
jaxrs:server/@address is set to "/bar" then it will be '/foo' which will be used to find a root resource class and its method...

I'd appreciate if you could try this feature and see if you can get data from JMS topics...

Thanks, Sergey

[1] http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSJmsTest.java (JMS 
client)
[2] 
http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/jms_server_config.xml
[3] http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JMSServer.java

[4] http://cwiki.apache.org/CXF20DOC/jms-transport.html

Hi

Is it possible to use a JMS Transport for JAX-RS (JSR-311) web service
endpoint ?

I'm interested in implementing an ATOM consumer service using abdera
(AtomEntryProvider), for both HTTP (RESTful) and JMS (topic
subscription) transports.



Thanks

Paul



Re: JMS transport for JAX-RS

Posted by Sergey Beryozkin <se...@iona.com>.
Hi Paul

This is something that we may try to do for 2.3. If it is possible to invoke
SOAP endpoints over JMS then surely there should be a way to do it for JAXRS
as well. I believe most of what needs to be done is already in CXF but some
work will have to be done. Perhaps jaxrs:server endpoints will need to be
configured with JMS transportIds but some changes might also need to be done
to the dispatching logic...
I'll create a JIRA...

cheers, SErgey


 

Paul Wilton wrote:
> 
> Hi
> 
> Is it possible to use a JMS Transport for JAX-RS (JSR-311) web service
> endpoint ?
> 
> I'm interested in implementing an ATOM consumer service using abdera
> (AtomEntryProvider), for both HTTP (RESTful) and JMS (topic
> subscription) transports.
> 
>  
> 
> Thanks
> 
> Paul 
> This e-mail (and any attachments) is confidential and may contain personal
> views which are not the views of the BBC unless specifically stated. If
> you have received it in error, please delete it from your system. Do not
> use, copy or disclose the information in any way nor act in reliance on it
> and notify the sender immediately.
>  
> Please note that the BBC monitors e-mails sent or received. Further
> communication will signify your consent to this
> 
> This e-mail has been sent by one of the following wholly-owned
> subsidiaries of the BBC:
>  
> BBC Worldwide Limited, Registration Number: 1420028 England, Registered
> Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ
> BBC World News Limited, Registration Number: 04514407 England, Registered
> Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ
> BBC World Distribution Limited, Registration Number: 04514408, Registered
> Address: BBC Media Centre, 201 Wood Lane, London, W12 7TQ
> 
> 

-- 
View this message in context: http://www.nabble.com/JMS-transport-for-JAX-RS-tp25753483p25757002.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: JMS transport for JAX-RS

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 24/09/13 07:16, kumarshorav wrote:
> Hi All,
>
> I am new to this list. I have developed a Rest Web service in JAX-RS jersey.

FYI, this is a list for users working with Apache CXF WS or RS 
implementations.

> It is deployed in JBOSS AS 7.1 server. Now I would like to provide
> asynchronous communication that can be achieved by using JMS. I am suppose
> to choose MOM  as Hornetq server. Then my question is how to integrate JMS
> with restful service endpoint. or in another way how would i call the rest
> service url inside jms. Please help me in this.
>
Note, JAX-RS 2.0 supports HTTP-based async invocations - ask at Jersey 
list for more info please.
Re JMS: both CXF and Resteasy support JMS transports AFAIK

Sergey


>
> Thanks
> Kumar SHorav
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JMS-transport-for-JAX-RS-tp568479p5734402.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: JMS transport for JAX-RS

Posted by Savas Ziplies <zi...@gmail.com>.
Hi Kumar

You can search for an earlier post from me. Unfortunately, you will come
into troubles with HornetQ and the JMS Transport. Unfortunately, the
defined naming for the messages is not allowed by HornetQ and the HornetQ
Messages will fail eventually.

You could override most of the messages and checks yourself, but this would
end in a lot of work.

If you have the option to choose a different Queue I would suggest to do
so, otherwise you could start overriding the JMS Transport with HornetQ
accordingly.


Best


On Tue, Sep 24, 2013 at 8:16 AM, kumarshorav <as...@gmail.com>wrote:

> Hi All,
>
> I am new to this list. I have developed a Rest Web service in JAX-RS
> jersey.
> It is deployed in JBOSS AS 7.1 server. Now I would like to provide
> asynchronous communication that can be achieved by using JMS. I am suppose
> to choose MOM  as Hornetq server. Then my question is how to integrate JMS
> with restful service endpoint. or in another way how would i call the rest
> service url inside jms. Please help me in this.
>
>
> Thanks
> Kumar SHorav
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/JMS-transport-for-JAX-RS-tp568479p5734402.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: JMS transport for JAX-RS

Posted by kumarshorav <as...@gmail.com>.
Hi All,

I am new to this list. I have developed a Rest Web service in JAX-RS jersey.
It is deployed in JBOSS AS 7.1 server. Now I would like to provide
asynchronous communication that can be achieved by using JMS. I am suppose
to choose MOM  as Hornetq server. Then my question is how to integrate JMS
with restful service endpoint. or in another way how would i call the rest
service url inside jms. Please help me in this.


Thanks
Kumar SHorav



--
View this message in context: http://cxf.547215.n5.nabble.com/JMS-transport-for-JAX-RS-tp568479p5734402.html
Sent from the cxf-user mailing list archive at Nabble.com.