how to use Servicemix to make SOAP Web Services comunicate - java

I want to build a system made by several WebServices that exchange SOAP messages through Servicemix. These WSs are not local, but they are remote. So my idea is providing Servicemix as a service itself, and all the others will send message to it. It will be Servicemix to deliver soap messages to the right Service, log and notify the success/fail of the delivery.
Is this doable? Is this a correct use of Servicemix? I can't find a good example or tutorial with this configuration.
I can build WSs easily starting from a wsdl, using the Maven archetype
servicemix-cxf-wsdl-first-osgi-bundle
and they can be deployed on Servicemix... but they will be all local! I want to make remote WSs exchanging messages through a shared bus.
Thank you

Sure, this is essentially the pattern for ServiceMix. Much of what you are looking for in terms of mediation and routing is realized through Apache Camel. You would need to host the remote web services in a separate web container, such as Tomcat or Jetty. Next, you would implement service endpoints as OSGi bundles that are deployed to ServiceMix. These OSGi bundles expose your service interface. When a SOAP request comes in to the OSGi bundle endpoint, you can then use Camel routing rules to route the SOAP message to the appropriate remote web service endpoint.
For some examples of this, I recommend checking out the JBoss Fuse documentation:
http://www.jboss.org/products/fuse/resources/
Fusesource used to be a support organization around ServiceMix; however, they have since been acquired by RedHat. You will find much better documentation and examples over the ServiceMix documentation itself.

Use Apache Camel for the routing, transforming etc.:
Camel is smart routing and mediation engine which implements the Enterprise Integration Patterns and is designed to be used either inside an ESB like ServiceMix, in a Message Broker like ActiveMQ or in a smart endpoint or web services framework like CXF. ServiceMix is an ESB, a JBI container and an integration platform. So they both address different needs though they are both designed to work great together.

Related

Communication between the standalone Java service and Tomcat8 through JMS

Is it possible to create a Communication between the standalone Java service and Tomcat8 through JMS?
I need that standalone service act as a Publisher and Tomcat as a Subscriber.
External devices send data over a socket connection on standalone service. Once the message is received and parsed, the service sends it to Tomcat.
I don't want to use DB for this communication.
Please send examples of the implementation. Preferred Spring JMS but not mandatory.
thanks in advance
It is doable with or without Spring JMS. Main point is that you would need to host JMS server somewhere anyway. Let say you are using ActiveMQ server.
You will need to add dependencies on ActiveMQ client libraries into both of your projects (Tomcat8 and standalone Jar). You can use Spring JMS in both projects.
Than you create queue in your Active MQ server.
Your sender application will use ActiveMQ client libraries to send the messages to created queue.
Your Tomcat8 application will register listener on created queue using ActiveMQ client libraries.
EDIT
Here are links I suggest to follow:
Installation section of ActiveMQ. Don't know your prefered system, so pick by yourself. It is very easy to install it.
Official Spring guide for creating JMS project. Use sending part for your standalone project and listener part for your Tomcat8 application.

Is possible to communicate the components which is running on different server by OSGI

We are going to develop large scale application by using J2EE. The application has contains many number of modules. For the purpose we have planned to split the application into module application and run it on different servers.
If i use OSGI, then is it possible to communicate between the two module component which is running on different server?
I am not familiar in OSGI. Please help me to find the solution for the large scale application
Thanks
You could start from the OSGi Remote Services Specification. Apache CXF project provides an implementation for that. Quoting from CXF web page:
It implements the Remote Services functionality using Web Services, leveraging SOAP over HTTP and exposing the Service over a WSDL contract.
In my experience, embedding CXF in Equinox (the Eclipse OSGi implementation) has been very easy.
However DOSGI is not the only way to go: queueing systems like JMS or distributed caches like Hazelcast can help you to distribute events and data across the system. These technologies can be easily embedded in OSGi as well.
Ok, here's another one ;)
If run with Apache Karaf you just need to install the Apache Karaf sub-project Cellar and it's corresponding DOSGi feature. With those two, you'll have 1) a clustering solution for Karaf and 2) a way for your Applications to communicate with different cluster-groups. All of this comes out-of-the-box with Karaf 3, just install the extra features cellar and cellar-dosgi :)
Another implementation of the Remote Services specification is Amdatu Remote:
https://amdatu.atlassian.net/wiki/display/AMDATUDEV/Amdatu+Remote
The Amdatu Remote subproject provides implementations of the OSGi Remote Services 1.0 (OSGi Enterprise R5) and Remote Service Admin 1.1 (under development) specifications.

Existing spring application extension by adding camel features

I have my web application written in Spring MVC. It is quite simple app for registering some activities and generating reports after some time. Now I have it done fully in Spring. The only entry point is HTTP webapp request. I'd like to add other entry points to allow user to trigger application via JMS queue, FTP files and SOAP-based web service.
I know I can do this all using Spring own features somehow, but I wonder if it is desirable to involve Apache Camel into all that stuff?
I think about leaving web application as it is (communicating directly with services), only add some Camel magic to spring context and expose several endpoints from Camel and then after messages processing and transformations call existing services.
I think about using Camel to be able to use some asynchronous processing and threads/scalability features. Is it the right way to go?
I will recommend you to use Apache Camel. I have used it for a similar purpose. The solution is an appropriate one from a 'Separation of Concerns' point. Camel implement Enterprise Integration Patters and is a better solution for integrating various protocols and interfaces. Your application should deal with functionality only and as designed should just expose a servlet to get requests and process it.
Handling of interfaces and protocols are well structured in Camel and its easy to maintain and configure in the long run.

Spring WS and UDDI

I have a bunch of web services implemented in Spring-WS 1.5.9. We use Maven to do our builds, our services run on OC4J that have a UDDI provider.
What we want to do is to start using UDDi internally to register our web services to allow other groups in the business to find and use them.
The problem is that I've not been able to find how to actually put this all together. How do I get the services to register them selves when they are deployed to the app server.
Spring doesn't seem to have any support or annotations. There doesn't appear to be a maven plugin.
I've got all the pieces but how do I put these together into an automated solution?
For service discoverability, Spring-ws provides the DestinationProvider interface to locate the edpoint of a service at runtime. You can use the Wsdl11DestinationProvider class to retrieve the endpoint from a WSDL available or you can implement your own class by extending AbstractCachingDestinationProvider using UDDi access libraries.
For the automatic publication, I am aware of Mule Galaxy wich is a Service Registry solution (not based on UDDI but on ATOM/REST) that provides connectrs to automatically import artifacts from Maven for example.
You could use UDDI4J it let you interact with uddi servers :)
Check out Apache jUDDI. It has annotations that youc an use to automate the registration process. I'm not sure what you mean by "internal use only" but can you run optionally run the full server in embedded mode without a web container) or it can be ran within Tomcat, Jboss, and most other containers.
Example: http://svn.apache.org/repos/asf/juddi/trunk/juddi-examples/uddi-annotations/
There's also a number of other solutions, such as WS-Discovery, mDNS, ebXML etc.

Example of using Mule ESB to route web service calls

I'm looking for an example of how to set up a very simple Mule configuration to route a SOAP web service call from a client to a service provider. Initially, there will just be one provider, and then I will want to add multiple service providers and a round-robin routing strategy in Mule.
Most of the examples on the Mule site have the service provider running within the Mule container. I want mine to be completely external.
If you don't need to decompose message arguments use HTTP pass-through, which is more light-weight and a lot simpler. For the round-robin implementation you could use a filter router with a groovy-based filter expression.
See here:
Create pass through with Mule ESB 2.2.1
http://www.mulesoft.org/documentation/display/MULE2USER/Outbound+Routers#OutboundRouters-Filters

Categories

Resources