I need to develop JMS based application which will asynchronously process inbound and outbound messages with third party systems.
Is it possible to develop generic JMS application which at runtime may use MQSeriers or WebLogic JMS? any examples of these?
If you want to use a App server agnostic Message System, you can try something line HornetMQ, RabbitMQ or ActiveMQ and check how you can use them from your application (these MQ's can be configured apart from any application server) or you can check how you can integrate them with a specific server.
Related
We are developing an OSGI (karaf container) based application and it is deployed in fuse ESB. We have some integrations like to ActiveMQ and to SMSC over SMPP etc. We are connecting and interacting with these systems with camel routes. I want to monitor the connections status of these systems by providing a interface implementation like motitor(SomeMonitoringInterfaceImpl):
String url = "smpp://smppclient1#localhost:2776";
from(url).motitor(SomeMonitoringInterfaceImpl).routeId("smpp-route").to("bean:smsSmppService?method=send").end();
is there a way to it?
Note that the camel-smpp component is trying to handle it without throwing any exception, which is understandable however which also hinders to monitor it.
I am creating a Java application in eclipse to let different devices communicate together using a publish/subscribe protocol.
I am using Jboss and ActiveMQ and I want to know if I should use an ActiveMQ resource adapter to integrate the broker in jboss in a standalone mode or I should just add dependencies in my pom.xml file and use explicit java code like indicated here http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html.
Here the documentation I found to integrate ActiveMQ within jboss in a standalone mode https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_A-MQ/6.1/html/Integrating_with_JBoss_Enterprise_Application_Platform/DeployRar-InstallRar.html
Could someone tell me what is the difference between the two approaches?
Here is the answer for my question:
The first approach starts a broker within your webapp itself. You can use a
normal consumer (not a message-driven bean - MDB), but only your webapp can
access it, via the VM transport (vm://).
The second approach lets the app server manage both the connection to the
broker and the creation of the broker, so it's probably also within the JVM
that runs your webapp and probably only accessible to your webapp, but
those details are hidden from you by the app server. You can only consume
messages via an MDB, but this provides a uniform interface that doesn't
need to change if you switch to another JMS provider in the future.
Since the standard way to integrate a JEE webapp with a JMS broker is via
the RA, I'd recommend using that approach simply for consistency and
standardization. That should also allow you to switch to a standalone
ActiveMQ broker (or another JMS product) in the future with minimal effort.
I'm trying to integrate instant messaging in my application that is based on the usual Spring-Maven stack. Two possibilities that I've come across are to either use raw Smack (igniterealtime.org) or go for the spring-integration support for XMPP (which is also based on Smack). My question is; "Is it required to run an XMPP server like openfire alongside or is there a possibility of the XMPP server running embedded within my application running on tomcat?". What would be an efficient scheme for the scenario? Thanks
The Smack (and therefore Spring Integration XMPP) is just an API (Client) for that protocol and what you need to know and configure is XmppConnection and particular host/port to connect.
To right an application based on those component you don't need to run an XMPP server.
For example we tested Spring Integration against regular Google Chat.
So, yes: Spring Integration doesn't run Embedded Server and even doesn't require an external to be run for you locally.
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.
I just need notification system. javax.jms.* - good solution I think, but I can't understand what do I need to use JMS?
I don't want to use any app. servers like GlassFish or Tomcat, I just would like to use standard jdk and myserver(very light) and myclient(very light too) and some MessageSystem to exchanging bitween myserver and myclient. As I understand to use JMS I need JMS Provider. For example: ActiveMQ. But I don't uderstand ActiveMQ needs any server?(GlassFish probably), and what kind of *.jar do I need from Java EE ?
JMS provider or more correctly a Message Broker can be a stand-alone application. Most of J2EE app servers include a broker inside them but yes we also have many very good stand alone JMS brokers, ActiveMQ is good, then there is OpenJMS and many others. And as they are stand alone they don't need another app server to run them. And they usually come with every needed jar as well :) SO you'll not need to copy any jar from other app-server to say ActiveMQ or OpenJMS.
ActiveMQ runs as a standalone server; it requires the Java VM like any Java application but nothing else beyond that.
Other stand alone JMS brokers (open source) which can be run standalone or even embedded in your Java application are Open Message Queue (OpenMQ) which is also included in GlassFish, and the new JBoss HornetQ message broker which will be the JMS implementation in JBoss application server.