Configure hornetq on Wildfly8 to send messages on JMS queue - jms

I have recently started using Wildfly 8 and noticed that Wildfly8 has a built-in JMS utility called Hornetq. My question is, how can I configure hornetq to send and receive message on a JMS queue using Wildfly8 server?

There are a number of good tutorials on the net about how to use HornetQ (JMS) from within Widlfly, I like this one for JMS 2.0:
http://www.mastertheboss.com/jboss-server/jboss-jms/jms-20-tutorial-on-wildfly-as
Here is the hello world example from Wildfly themselves, illustrating how to implement an MDB and the respective listeners and topics:
https://github.com/wildfly/quickstart/tree/8.x/helloworld-mdb
That page describes everything in excellent detail and demonstrates the use of JMS 2.0 and EJB 3.2 Message-Driven Bean in WildFly 8. The project is runnable with maven and creates two JMS resources:
A queue named HELLOWORLDMDBQueue bound in JNDI as java:/queue/HELLOWORLDMDBQueue
A topic named HELLOWORLDMDBTopic bound in JNDI as java:/topic/HELLOWORLDMDBTopic
If you are having trouble with configuration of queues etc. in the standalone, the docs here are actually quite helpful as well:
https://docs.jboss.org/author/display/WFLY8/Messaging+configuration

Related

Send a message to wildfly JMS message queue using spring boot

My questions is related to an older post.
I am trying to publish a message to a Wildfly JMS queue. Right now the queues and the app run on the same JBoss container. I am trying to create a new Spring Boot app that can publish messages to the existing queues from another container. Since Wildfly is old I am not finding much help online.
All JMS clients (including Spring JMS) need basic things like JNDI context properties, admin object names, etc. You can refer to the Wildfly Hello World JMS Quickstart for these details and then plug them in to your Spring Boot application. The actual names of the admin objects (i.e. connection factory, queue, etc.) will, of course, vary based on your particular configuration.

How to bridge between IBM MQSeries and ActiveMQ Artemis 7.x?

Has anyone succeeded in creating a bridge between IBM MQSeries (MQS) and ActiveMQ Artemis 7.x (AMQ 7) so that the later can send messages to and receive from the first? Currently I have no problem bridging between MQS 7.5 and AMQ 6.3 by deploying a camel route and MQS libraries on the broker itself. However, the same way doesn't work anymore as each route deployment requires a broker reconfiguration and restart.
Thanks in advance for any feedback.
A few examples ship with ActiveMQ Artemis which might be helpful:
The "inter-broker-bridge" example in the examples/features/sub-modules/ directory. This example demonstrates how to deploy an instance of org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl to the broker using Spring in a web application.
The "camel" example in the examples/features/standard/ directory. This example demonstrates how to deploy a Camel route to the broker using Spring in a web application.
I can't speak to whether or not either of these can be updated at runtime as I've not actually attempted that. Both of these options should be able to move messages in either direction (i.e. from Artemis to MQS or from MQS to Artemis).
Another option would simply be to run Camel standalone and deploy your routes there. This would give you more flexibility as it would allow you to specifically choose the hardware where the routes run as well as how many resources the Camel JVM consumes. Running Camel routes directly on the broker, while convenient, isn't a great fit because the broker is a broker and not an application server.
To be clear, ActiveMQ Artemis and IBM MQSeries are not directly compatible with each other and are not expected to be. This true for most (if not all) JMS broker implementations. The role of components like the ActiveMQ Artemis JMS bridge and integration platforms like Camel are to solve the compatibility problem by using a common API to speak to both brokers - JMS in this case. Any broker which implements JMS can be integrated using these methods.

Multiple ways to configure MQ or ActiveMQ Listener

Can someone explain different ways of configuring message listener.
I know two ways:
Spring Jms Listener
EJB MDB way.
Are there any other ways (should be applicable to both IBM MQ and Active MQ)?
For the first question, your proposed ways are good ones with Camel JMS.
For the second question take a look at Java JMS mix messaging implementations
if you want to use the same client without changing anything you have to use AMQP ptotocol wich is designed for this.
here is 2 examples :
ActiveMQ AMQP with JMS transformer leveraging spring Integration
Unable to access ActiveMQ using JMS based code and amqp 1.0

Build a standalone JMS client using JAVA

I am new to JMS and I need to build a generic JMS client to create a connection send and receive message by using queues and topics. I have seen many example using activeMQ connection factory, but I need a generic client which can use any connection factory and create a connection. Any leads or sample codes will be useful.
I have just done that recently. Steps I've taken
Read Java JMS tutorials to understand what is JMS.
You can code in Java or use a framework for example - Spring JMS
Read about MQ provider docs. for example activeMQ or IBM MQ.

Bridge between ActiveMQ and MSMQ

Let's say there is an ActiveMQ as JMS broker which is fed by a master system based on java.
One of the consumers can work with MSMQ only (and we can do nothing with it)
Question Is there an easy way to forward jms text in jms messages in ActiveMQ topic to some message at MSMQ destination?
Underlying jms message contains the text of an xml file.
Depends a bit on your preferences, but a simple Camel route in ActiveMQ dispatching messages to MSMQ can do this easily - GIVEN you run your AMQ on Windows.
Camel does not really support MSMQ, but you can use some simple java lib to dispatch messages inside a java processor.

Resources