Is there any recommended way to implement REST Web Service with Netty?
I am a RESTEasy user, is there a way to use Netty and RESTEasy together?
Looks like since version 2.3.4 of RESTEasy it supports an embedded Netty container: http://docs.jboss.org/resteasy/docs/2.3.4.Final/userguide/html/RESTEasy_Embedded_Container.html#d0e2690
I'm not aware of a way to use RESTEasy with Netty. I used restexpress [1] in the past.
[1] https://github.com/RestExpress/RestExpress
Resteasy + Spring + Netty sample I used : https://github.com/leiguorui/netty-resteasy-spring
Related
Does CXF 3.1.x really uses Apache HttpComponents - HttpClient for http transport? Maven dependencies does not list "Apache HttpComponents" as dependency nor do I see any HttpClient class in the CXF jars? However CXF JIRA CXF-6704 discusses about it?
I need access to HttpClient in CXF for NTLM support per connection basis which CXF by default relies on Java 6+ Authenticator which is set per JVM.
CXF has a decoupled runtime layer. Mostly they start with cxf-rt-*.
In the case of transports, cxf-rt-transports-*.
Take a look at this. I believe that this is the HTTP Components transport runtime.
EDIT: I think this is for asynchronous transport - (looked at the pom after I posted this).
EDIT2: I did a little more research on this and found this documentation. It says that the async client can be used for synchronous calls by setting use.async.http.conduit bus property to true. This also specifically refers to NTLM authentication.
I have seen the other questions on CXF under CDI but they all seem to be for JAX-RS style web services.
Is JAX-WS possible in this configuration? If not, how can I expose a JAX-WS service using CDI/Weld in a non-EE container (Tomcat 8)?
If you want to use CDI and JAX-WS in Tomcat then most possibly the easiest you can do is to use Apache TomEE.
TomEE is basically a standard Apache Tomcat, but pimped with lots of JavaEE libs. It brings a full CDI container, JAX-RS, JAX-WS etc.
For JAX-WS you should take the 'plus' variant.
If you want it really just embedded or smallish (in size, not in power), then you can also take a look at Apache Meecrowave and bundle the JAX-WS part of CXF to it.
Meecrowave is a EE8 technology based smallish (9MB) Application Server which can be used standalone or embedded (via Meecrowave#bake()). It's pure Apache:
Tomcat (Servlets-4.0), OpenWebBeans (CDI-2.0), Johnzon (JSON-P_1.1, JSON-B_1.0), CXF, log4j2.
First, you have to enable CDI on tomcat. See here.
In my case, #Inject did not work on classes with #WebService but I was able to inject using CDI.current().select(MyClass.class).get().
It did not work on #PostConstruct though, but you can use it inside a #WebMethod.
[Note] I was using Metro instead of Apache CXF
Can some body expalain what is the benefit of developing JAX-WS webservice using apache CXF over normal JAX-WS provided by Java 6.
JAX-WS is only the api / specification - to use it you need an implementation. It can be something like CXF, Axis or the one provided by the application server (JBoss, Weblogic et..).
One advantage of using CXF is that you have more flexibility in terms of deployment. It can be deployed in a web container or you can use an embedded web container and runt it as a stand alone application.
CXF also provides integration with other frameworks like spring.
It also provides tools to work with schema / WSDL etc..
Apache CXF is a open source webservice framework which contains JAX-WE and JAX-RS and also it helps to integrate with spring framework
CXF Supports
1) XML , JSON Format
2)JAXB Data Binding
3) SAOP ,REST,HTTP protocal binding
I have recently completed the web service implementation with JAX-WS using reference implementation apache-cxf. And I found with CXF - integration with Spring is very easy. Moreover, It provides various features like:
Customization of Logging features
Inbound and Outbound interceptor
Application Level security
Easy Exception handling using custom Fault.
For more detail, if you want, please checkout this link: http://predic8.com/axis2-cxf-jax-ws-comparison.htm
And, I read above link, its preety helpful for me.
Thanks !
This might be obvious but i just still don't understand how i'd do it with ServiceMix :
An external web service http://mypartner.com/service/partnerService
My platform is for example http://myservicemix.com/
I'd like to use OSGI bundles
Is this what i need ? :
A cxfbc:provider (this is the one that talks to the remote service, just a wsdl in the bundle right ?)
A camel route and transformations to bridge the two
A jaxrs:server (i'd like to expose it as a REST service)
The cxfbc is a JBI component. JBI is essentially dead/legacy, so I suggest to not use that for new projects. You can read more about JBI is dead here: http://gnodet.blogspot.com/2010/12/thoughts-about-servicemix.html
So Apache ServiceMix is the server where you can host your Camel applications. So I suggest to look into how to do a webservice proxy with Camel.
For example there is an example with Camel
http://camel.apache.org/cxf-proxy-example.html
That example is OSGi ready and can be deployed in Apache ServiceMix.
Also check out some of the CXF examples that are shipped with Apache ServiceMix, in the examples directory
The Camel CXF component can do both REST and WS.
Also there is the camel-restlet component for REST support as well: http://camel.apache.org/restlet
Greetings all
I am using Apache Camel and Apache CXF in this example:
http://camel.apache.org/better-jms-transport-for-cxf-webservice-using-apache-camel.data/cxfcamelexample.zip
and I want to use AMQP instead of JMS but I don't know the configuration,
also I need to change the version of QPID client
if anyone can help, this will be great, thanks in advance.
Have you seen the unit test of camel-amqp component?
https://svn.apache.org/repos/asf/camel/trunk/components/camel-amqp/
I don't think the AMQP component which is developed based on Qpid project is matured to a stage where it can work succesfully. There is no good POC supported for this component either. Check http://camel.465427.n5.nabble.com/jira-Created-CAMEL-2872-camel-amqp-not-receiving-messages-td511735.html