Monday, 2 July 2018

JMS Client tool to easily post messages to ActiveMQ, HornetQ or Weblogic. Could be used for testing

Setting up a jms client can be a little tricky when put into practice.

I will try to summarize the properties and jar libraries needed for ActiveMQ, Hornetq (embedded in Jboss 7.1 and Wildfly 8.2) and Weblogic:

Activemq

       
initialContextFactory =  org.apache.activemq.jndi.ActiveMQInitialContextFactory
url =  tcp://localhost:61616
connectionFactory,ConnectionFactory
queue.jndiQueuName = brokerQueueName
user =
password =

Jboss 7.1 - HornetQ 2.2.11


       
initialContextFactory =  org.jboss.naming.remote.client.InitialContextFactory
url =  remote://localhost:4447
connectionFactory = jms/RemoteConnectionFactory
queue.jndiQueuName = brokerQueueName
user = 
password =



Wildfly 8.2 - HornetQ 2.4.5


       
initialContextFactory =  org.jboss.naming.remote.client.InitialContextFactory
url =  http-remoting://localhost:8080
connectionFactory = jms/RemoteConnectionFactory
queue.jndiQueuName = brokerQueueName
user = 
password =


Weblogic

       
initialContextFactory =  weblogic.jndi.WLInitialContextFactory
url =  t3://localhost:7001
connectionFactory = ConnectionFactory
queue.jndiQueuName = brokerQueueName
user =
password =


Running the application:


If you intend to post your messages with no hustle just by providing a connection file, a header properties file and a payload that you can edit freely. You can use this tool to script JMS posting in your tests.


       

git clone https://github.com/duband/JMSPoster.git

cd JMSPoster

mvn clean install

mvn com.github.duband:jmsposter:[version]:install -DinstallationDirectory=[your installation directory] -DtargetBrokerType=[activemq|weblogic|hornetq-jboss7.1|hornetq-wildfly8.2]
cd [your installation directory]

postMsg.bat



No comments:

About Me

My Photo