Hi,

Regarding JMS transactions:

To activate resource local transaction is enough to set sessionTransacted to 
true (as parameter of JMS URI, if you use JMS compliant configuration style; or 
in JMSConfiguration if you use CXF 2 style).

In case if you use JTA transactions (for example to fulfil DB and JMS 
operations in the same transaction) it is necessary to configure transaction 
manager and specify it as parameter in ConnectionFactory.

There are some details in http://cxf.apache.org/docs/jms-transactions.html .

Regards,
Andrei.

> -----Original Message-----
> From: Sergey Beryozkin [mailto:[email protected]]
> Sent: Mittwoch, 3. September 2014 23:20
> To: [email protected]
> Subject: Re: jaxrs jms transport
> 
> Hi
> 
> Can you please start from JAXRSJmsTest ?
> It does show how to echo the data via POST.
> 
> I can see the test configuration now uses a "http://www.w3.org/2010/soapjms/";
> transportId, but "http://cxf.apache.org/transports/jms";
> should actually work.
> 
> I've never tried it to work with the transactions. I may need to ask 
> Christian for
> some advice on how to make it work (assuming it does not work OOB with
> some extra configuration).
> 
> Please give the test a try though, the test runs OK in builds.
> We also have a couple of demos where a single JAX-RS endpoint gets both HTTP
> and JMS messages but those demos still depend on 2.7.x and CXF JMS Transport
> support has completely changed in 3.0.x.
> 
> Let me know if you can make the basic POST work first and in meantime we
> will investigate how to make the transactions work
> 
> Thanks, Sergey
> 
> On 03/09/14 18:12, Sylvain Mougenot wrote:
> > Hello,
> >
> > I've some jaxrs resources I'd like to access in JMS.
> > Like this guy :
> >
> >      @Path("/urlplan/{codeArmoire}")
> >      @POST
> >      @Consumes(MediaType.APPLICATION_JSON)
> >      @Produces(MediaType.APPLICATION_JSON)
> >      public List<UrlPlan> getUrlPlan(
> >          @PathParam("codeArmoire") String codeArmoire,
> >          UrlPlanQuery urlPlanQuery)
> >          throws MapException
> >
> > I tried to do this using the resources I've found on the documentation
> > https://cxf.apache.org/docs/jms-transport.html
> > https://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvanc
> > edFeatures-JMSSupport
> >
> > I also found simplistic exemple in the tests source code
> > (JAXRSJmsTest.java).
> >
> > But I can't make this to work.
> >
> > Questions:
> > Is there a complete working sample code for my case :
> > - jaxrs resources
> > - accessed via jms transport
> > - with error management
> > - with body in POST request (actualy some geojson)
> > - with transaction in order to have rollback, redelivery and DLQ
> >
> >
> > I'm using CXF 3.
> > There are some source code in the attached zip, including dependencies list.
> >
> >
> > My problems :
> > - the body never gets to my resource method parameter 'urlPlanQuery'
> > - when error occurs the jms message is lost (no DLQ, just error logs)
> > - when I adapt code just as a poc, the result is never writen
> > : message.getContent(OutputStream.class) is always null so I've a NPE
> > in PrimitiveTextProvider#writeTo
> >
> > Sylvain Mougenot
> >

Reply via email to