Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF389D0AB for ; Thu, 28 Jun 2012 10:48:24 +0000 (UTC) Received: (qmail 31648 invoked by uid 500); 28 Jun 2012 10:48:24 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 31571 invoked by uid 500); 28 Jun 2012 10:48:24 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 31557 invoked by uid 99); 28 Jun 2012 10:48:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2012 10:48:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2012 10:48:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2F1AB238899C for ; Thu, 28 Jun 2012 10:48:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r823593 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-advanced-features.html Date: Thu, 28 Jun 2012 10:48:00 -0000 To: commits@cxf.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120628104800.2F1AB238899C@eris.apache.org> Author: buildbot Date: Thu Jun 28 10:47:59 2012 New Revision: 823593 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/docs/jax-rs-advanced-features.html Modified: websites/production/cxf/content/cache/docs.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/cxf/content/docs/jax-rs-advanced-features.html ============================================================================== --- websites/production/cxf/content/docs/jax-rs-advanced-features.html (original) +++ websites/production/cxf/content/docs/jax-rs-advanced-features.html Thu Jun 28 10:47:59 2012 @@ -124,11 +124,16 @@ Apache CXF -- JAX-RS Advanced Features

JMS Support

-

CXF has been designed such that multiple transports can be supported for a given endpoint. If you would like your JAXRS endpoint be capable of serving not only HTTP but also JMS requests then you need to specify a JMS transportId, example :

+

CXF has been designed such that multiple transports can be supported for a given endpoint. CXF JAX-RS endpoint and proxies can optionally
+support the JMS transport.

+ +

Endpoints

+ +

If you would like your JAXRS endpoint be capable of serving not only HTTP but also JMS requests then you need to specify a JMS transportId, example:

@@ -156,6 +161,29 @@ jaxrs:server/@address is set to "/bar" t
 
 

By referencing a bean such as 'org.apache.cxf.systest.jaxrs.JMSBookStore' from multiple jaxrs endpoints you can ensure that both HTTP and JMS requests are handled by the same service bean. In such cases you may want to use a CXF JAXRS specific ProtocolHeaders context which will let you get either HTTP or JMS headers.

+

Client

+ +

Starting from CXF 2.5.5 and CXF 2.6.2 it is possible to use the client proxies to invoke on JMS endpoints. All one needs to do is to provide a JMS endpoint address and then continue working with the proxy as usual. For example:

+ +
+
+// setup the the client
+String endpointAddressUrlEncoded = "jms:jndi:dynamicQueues/test.jmstransport.text"
+             + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+             + "&replyToName=dynamicQueues/test.jmstransport.response"
+             + "&jndiURL=tcp://localhost:" + JMS_PORT
+             + "&jndiConnectionFactoryName=ConnectionFactory";
+               
+JMSBookStore client = JAXRSClientFactory.create(endpointAddressUrlEncoded, JMSBookStore.class);
+Book book = client.getBook("123");
+assertEquals("Get a wrong response code.", 200, WebClient.client(client).getResponse().getStatus());
+assertEquals("Get a wrong book id.", 123, book.getId());
+
+
+ +

The client runtime will set up the JMS properties described in the previous section according to JAX-RS and other annotations (such as org.apache.cxf.jaxrs.ext.Oneway) available in JMSBookStore resource class.

+ +

FIQL search queries

Introduction