Can I invocate a route in Fuse ESB and wait for a reply? - synchronous

Can I invocate a route in Fuse ESB from my application (maybe by using Exchange Send) and then have my application class wait for and receive a reply from Fuse ESB, after the route has done its job?

Yes, this is the request/reply EIP pattern: http://camel.apache.org/request-reply.html
You can send a message to Camel from Java code using the ProducerTemplate API: http://camel.apache.org/producertemplate.html
And it has methods that support the request/reply pattern, which are methods typically named with request.
When you do this, then the producer template will wait for the reply message automatic.

Related

Do both receiving and sending end need to setup IBM MQ?

My application only reads messages from the IBM MQ. I am trying to understand, if one of the end is only reading messages from queue, do both sending and receiving ends need to setup JMS provider(IBM MQ)/Connection factories, Queue destination?What is the difference between JMS provide and Queue manager? Who needs to install JMS provider and Queue manager?
You can think of the queue manager as the server where queues and other MQ objects live. Your application is the client that connects to the server and interacts with the objects there.
IBM MQ server/queue manager IS your JMS provider. Your client application needs the IBM MQ implemented JMS libraries (IBM MQ Classes for JMS) and the JMS api which you can then use in your application to add parameters to your connection factory to connect to the queue manager.
You can see a basic tutorial for a JMS MQ client application here.
Depending on who is in charge of your queue manager and how they have set things up, you should probably not be hard coding the queue manager and queue details in your client application. You should be getting the connection details from the JNDI store if you have an administrator who has set one up for you. See more at the bottom of the JMS tutorial I linked to, for how JMS works.

Is middleware needed for a REST service to be consumed?

There is an external web-service (REST based) which provides logistics service. In order to consume it from our application (which is java stack), I created a client library (using jersey and jackson, which is a self-contained jar file, and gives simple getters and setters to work with). All that is needed to consume this REST service is this jar file (which is being used as re-usable asset).
However, one of our clients asked, "since we already have ESB (a middleware from IBM) for our existing integrations, why can we not have this integration also through ESB ?"
Is it possible to consume the REST based service using a middleware such as ESB(or MQ) ? If so, how ?
Will it be wise to do it ?
What arguments can I posit to my client to tell them this may not work ?
Thanks.
Is it possible to consume the REST based service using a middleware such as ESB(or MQ) ? If so, how ? -
Yes. Every ESB has its syntax/APIs. Should not be difficult to understand if you are already working with REST/http requests. Note, MQ is a message broker that will allow asynchronous communication. For example, the application that wants to consume the REST service can send a message to the broker and not wait for a response from the external service. The message broker in turn can talk REST to the external service. The message broker might expose a REST interface to consume messages. But it all depends on the use case. You may want to call REST service synchronously.
Most ESBs support calling external web services REST/SOAP. So an ESB does not necessarily mean MQ.
Will it be wise to do it ?
It depends. Many organizations set up ESB/Gateway as a policy and to route/filter/govern all external routings. Also to manage load, HA etc.
What arguments can I posit to my client to tell them this may not work ?
It will most certainly work. You should assess if using an ESB is an overhead based on your requirements.

Using the same WSO2 ESB proxy service for two or more SOAP requests... is it possible?

I have deployed some proxy services in WSO2 ESB because I have to ask the endpoint for several responses (dataset), according to different soap action. Every response must be set in a file, so I set an appropriate sequence in the outSequence of the proxy service, and this sequence writes the soap answer into a file.
In this way i have to deploy a proxy service and a sequence for EVERY soapAction, so i ask: is there a way for deploying a single proxy service for a given web service and using it with several sequences according to the soapaction to perform?
My question was born by the need to implement several scheduled tasks that take a dataset from an endpoint (webService) and write it into a file, but i don't want to deploy so much proxy service for every kind of dataset I have to request to the web service!
I hope my question is clear.
You do not necessarily create a diffrent proxies for each and every soapAction. You can utilize the filter mediator in the OutSequence of single proxy and do the header base routing to relevant VFS endpoint.

How do I communicate apache MQ with wso2 BAM server? (no ESB keeping it simple)

I am trying to get some simple web statistics using a wso2 BAM server, I have installed it, I understand how the events are defined, stored on the casssandra database etc. but I lack the most important thing: how to pass the events themselves to the BAM server?
I have programmed systems where json files are stored in a file ("queue") and my java process reads and processes them every 30 seconds, I thought this would be similar but the truth is I am pretty lost.
The port 7611 is TCP, listening.
Do I have to send the BAM server the events throught it?
Any help would be greatly apprecciated!
AFAIK, WSO2 BAM is not supported for apache mq directly. you have to use ESB or CEP to send events to BAM through thrift (Then you can use apache mq to send the events to ESB/CEP and through any of these product, you can send the events to BAM) .
But You can use the REST api to send the events to BAM which is more simple approach. Please refer the doc [1]. I thing future releases of BAM will support for jms (FYI, refer [2]).
[1] http://docs.wso2.org/wiki/display/BAM220/REST+API
[2] WSO2 BAM with JMS
Thnaks,
Mohan
BAM can get events either through REST API or through Thrift API.
7611 is the unsecured Thrift port and 7711 is the secured Thrift port by default.
As currently BAM does not have out-of-the-box Data Agent for Apache MQ, you have to write a one yourself.
If you want to publish events directly to BAM using Java you can use the DataBridge component in WSO2 code base. (i.e., use https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/data-bridge/org.wso2.carbon.databridge.agent.thrift/4.1.1)

Apache CXF: Publishing a Web Service (SOAP over JMS) with failover feature

Apache CXF: It seems that failover feature is available, but for clients. I need to create a service that is binded to a JMS queue of a particular JMS server. The JMS provider(TIBCO) has capability of failing over. Is there a way in which I can allow my service to failover to another JMS server at runtime and publish it there? If cxf is not capable of doing this, is there any other framework which allows failover feature for publishing services over JMS?
Vidish,
Server :
The TIBCO EMS administrator needs to configure the FT connection factory and provide the connection factory name and URL details to you. Configure those details in your JMS configurations - that's all needed for server.
Client :
TIBCO JMS API provides failover mechanism. Sample code is available in TIBCO EMS installation folder.
Joy