How to add external messaging broker to Wildfly? - java

i'm using Wildfly to deploy an EJB war that use an external messaging broker Apollo not the the one that come with wildfly ActiveMQ artemis.
What i must to do setup a JNDI configuration in standalone-full.xml file but there isn't any helpful tutorial to do this i don't know what exactly i need to change in the configuration to make this happen?

Is this post any help?
https://docs.jboss.org/author/display/WFLY10/Connect+a+pooled-connection-factory+to+a+Remote+Artemis+Server
I was able to use an external artermis broker (not the Wildfly container) following the above example.

Related

JMS communication between WAS 6 and JBOSS EAP 6.1

I have an application deployed in Websphere which should push a message in a queue implemented in JBoss using HornetQ. That message will then be consumed by an MDB within another application (on JBoss). Is that even possible?
In summary:
WAS (producer) -> JBoss (consumer)
I think yes because the protocol JMS is shared, but what are the details? should I load JBoss with MQ libraries or is it all in the way I refer to the JBoss queue from WAS?
Thank you so much.
If the MDB deployed on JBoss EAP is receiving a message from a local queue in HornetQ, then you do not need to deploy any MQ jars.
All you will need to do is write a MDB application and read the messages in your onMessage(Message msg) method. It should be really as simple as that.
You can see an example of a MDB in the jboss eap quick start . The HelloWorldQueueMDB.java class is the one you might be interested in. Follow the code in that class and modify the destination annotation value for your particular HornetQ queue name (from standalone-full.xml or standalone-full-ha.xml or the full or full-ha profile in your domain.xml file).
On a side note, JBoss EAP 6.1 is quite old. I would highly recommend upgrading to JBoss EAP 6.4.13 or later.

ActiveMQ 5.1.1 WebSphere 8.5.5 Activation Spec configuration?

Thanks to Maarten I was able to get basic ActiveMQ JMS topics and connection factories working in WAS. He has a nice write up in his reply to this topic: ActiveMQ 5.11 with WebSphere Application Server 8.5
But I cannot find a way to define any ActiveMQ JMS Activation Specs in the WAS admin console. And of course I need those in order to trigger my MDBs. ActiveMQ simply doesn't show up as a JMS provider when creating a new AS.
How do I configure Activation Specs in WAS using ActiveMQ as the provider? Am I missing a jar file?
activemq-client-5.11.0.jar
hawtbuf-1.11.jar
slf4j-api-1.7.10.jar
If you want to use Activation specification, you need to install ActiveMQ as JCA 1.5 compliant resource adapter. As far as I know, ActiveMQ provides resource adapter as separate install.
See also:
Deploying the ActiveMQ Resource Adapter into IBM WebSphere
Managing messaging with a third-party JCA 1.5 or 1.6-compliant messaging provider
ActiveMQ resource adapter
Listener ports are stabilized, and should only be used if provider doesn't support JCA.
Really straight forward once you understand (of course).
From the IBM Redbook mentioned above, sg247770.pdf, we need to configure ActiveMQ as a Generic JMS provider in WAS. And since we want to use Activation Specs, again from the Redbook, we need to use the ActiveMQ Resource Adapter, or rar file. There is a link on the ActiveMQ page to the latest rar, I don't need to provide it here. Once the rar is installed, using the WAS Console/Resources/Resource Adapters menu, you can configure J2C CFs, ASs, and administered objects including Queues and Topics from the rar configuration page. These will all have custom properties where you will enter your destinations, etc.

Overview of camel endpoints?

I have deployed my camel integration projects (WAR) on a JBoss Wildfly application server.
I was wondering if there is a way to see what endpoints are available and what the URL's are?
In a similiar way as i can log into the administration console under Wildfly and select web services to get an overview of what is deployed?
Thanks in advance for your help.
Yes, if you have JMX enabled on your camel context, then you can view a list of endpoints via jconsole, as you can see from:
JMX is on by default according to the camel site but if you've somehow disabled it, adding:
<jmxAgent id="agent" disabled="false"/>
to your <camelContext> element should be enough to re-enable it.
There is also hawtio which is a web console to manage Java stuff, and it has plugins for Apache Camel, JBoss, and others too.
You could then install hawtio in wildfly, and then see your Camel routes / endpoints and whatnot
http://hawt.io/

Integrating existing tomcat server with Active MQ?

I am using tomcat as webserver. Planning to use active mq for messaging purpose. Just started learning about jms and activeMQ.
Gone thru https://activemq.apache.org/getting-started.html. What i have got is active mq comes with its own web
server(probably apache IS not sure). My question is what if I want to use existing tomcat server instead of installing
new server for active mq. Is it possible?
UPDATE: i think i can itegrate existing tomcat with https://activemq.apache.org/tomcat.html
Yes Apache ActiveMQ is a light-weight broker, so you can deploy it in Apache Tomcat as a WAR file. Or try Apache TomEE which comes out of the box with AcitveMQ.
http://tomee.apache.org/apache-tomee.html
If you deploy ActiveMQ as a WAR file then it does not come with its own web service, its only the standalone distribution of ActiveMQ that comes with Jetty as its web server. You just don't need to include Jetty in your WAR file with ActiveMQ embedded.
At Apache Camel we have an example of a WAR file with ActiveMQ and Camel as a WAR file you can deploy in Tomcat. You can take a look, and just remove Camel from the example:
http://camel.apache.org/activemq-camel-tomcat.html
See these:
http://blog.octera.info/2011/06/how-to-embed-activemq-in-tomcat/
http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html
Basically, you just start a broker in your web application. If you need to retrieve some resource like ConnectionFactory or Destination(Queue/Topic), you can use Tomcat JNDI support to do this.

OpenEJB Standalone -- Non-JMS MDB Fails to Deploy

I just want to go 'live' with the setup that is currently working beautifully in testing. I've downloaded the standalone OpenEJB server and put my EJBs in the /apps directory.
The output in the logs suggests the standalone server may not support non-JMS adapters:
Deployment 'SocketMDB' has message listener interface com.example.TCPMessageEndpoint but this MDB container only supports interface javax.jms.MessageListener
Note the other modules, including the RA itself seem to startup successfully. The only issue seems to be with creating consumers of non-JMS messages.
What else might I try to look at or configure? Thanks!
In the testing scenario we wrap all the modules we find in the classpath up into an EAR and deploy that. To mimic that environment, try putting your rar and ejbs into an EAR file and drop that into the apps/ directory. You should get the same results as with an embedded scenario.
I've ended up just driving an embedded OpenEJB container for further testing. Will try to post new results here when I have them.

Categories

Resources