Using ActiveMQ and GlassFish together - java

Latest version of both, can not see how to enable ActiveMQ as an endpoint in Glassfish. Would like to use ActiveMq as the JMS provider in Glassfish, the stuff I found on google does not make sense. Any advise welcome.
Is it possible to just use the JMS connector and poitn at ActiveMQ - believe not but have I just configured wrong ?
Thanks

Please look at this tutorial: http://javadude.wordpress.com/2011/07/21/glassfish-v3-1-running-embedded-activemq-for-jms-part-1/

I've written an article (based on Sven's) that describes how to connect an external activemq broker to glassfish and deploy a Message Driven Bean that consumes messages from ActiveMQ.
You can find it here: http://geertschuring.wordpress.com/2012/04/20/how-to-connect-glassfish-3-to-activemq-5/

Deploy activemq-rar-[version].rar as Connector Application to Glassfish
You will need some *.jars (http://weblogs.java.net/blog/rampsarathy/archive/2007/03/glassfish_v2_an_1.html) in \domains[domainName]\lib\ext
Create Connector Connection Pool with ActiveMQ
Create Connector Resource (Factory) with Connector Connection Pool from 2.
Create Queues.

Related

Monitoring ActiveMQ Artemis apart from Jolokia

I hope to monitor ActiveMQ Artemis instances by configuring and using a SNMP connector by means of known Java properties
-Dcom.sun.management.snmp.interface=127.0.0.1 -Dcom.sun.management.snmp.port=50000 -Dcom.sun.management.snmp.acl=true -Dcom.sun.management.snmp.acl.file=/app/artemis/.snmp.acl
As ActiveMQ instances were monitored, but it does not work -- No error message is reported for Java SNMP properties, but no process is listening the chosen UDP port.
Is still possible to monitor ActiveMQ Artemis this way? And using JMX?
The SNMP agent was removed from Java 11 so that may be why it's not working for you.
However, you can certainly monitor ActiveMQ Artemis via JMX. See the documentation for more details on that.
If you just want to keep an eye on metrics you can use a metrics plugin. Using a plugin like the Prometheus metrics plugin would allow you to see exactly what's happening on the broker, set up alerts, etc.

How to configure remote queueing using Active-mq (jBoss EAP 7.2) on both sides

I did search on jBoss EAP 7.x documentation but didn't find any detailed explanation on how to do the configuration I'm looking for: [jBoss EAP 7.2] <--Remote queues--> [jBoss EAP 7.2 - The actual Queues are here]
As I used to do on jBoss EAP 6.4, I was using Netty with remoting configuration with Acceptor/Connector on Client Side with a defaut remoting on the port 5445.
I'm here to find out the best used practice on how to configure and what are the Actual configurations to be done (which variable on which module etc...)
Thank you community.
You shjould be able to do the same: create a connection factory and a connector on your 'client' server to connect to the acceptor on the 'server' server.
As proposed the solution:
- Using Acceptor on "Server" server side
- Using Connecor on "Server" client side
Another hint is using the Outbound-socket-binding to choose where to the remote queues will publish/read data.
Thanks community.

Is it possible to embed activemq broker into my servlet-container?

I have a few tomcat servlet-containers and I need to deploy activemq within one of them to allows the other containers connect to that broker. All the tomcats runnning on the same machine.
I need to avoid deploying a standlone message broker now, beucase it's not allowed by out producion evironment.
To be more specifiec, I'm using spring framework and as far as I understood we can write the following in order to start the embedded broker:
BrokerService broker = new BrokerService();
// configure the broker
broker.addConnector("tcp://localhost:61616");
broker.start();
But does it allow to connect to the broker not only within the same application, but also from the other tomcat instances using the 61616 port?
Yes that allows remote connection on port 61616.
At Apache Camel we have also an example of embedding ActiveMQ broker in a WAR application, and using the xml configuration of ActiveMQ. You can find it here: http://camel.apache.org/activemq-camel-tomcat.html

JMS Bridge between Active MQ and WebLogic

I am working on a migration project where we have implemented JMS server from WebLogic to Active MQ. THe problem is that the client is still on weblogic and we dont wish to change that .
The connection factory used in server is or.apache.context.InitialContextFactory whereas in weblogic its org.weblogic.WLConnectionFactory. Please help in creating a bridge between these two.
Can't we create a JNDI factory by "org.weblogic....." in active MQ and use it for look up.
Please help.
Thanks & Regards,
Tushar
I think no, because if you create org.weblogic..... in JNDI, it will look for the same class in activeMQ jar, and will fail. Better to have weblogic on both client and server.

JMS non-MDB client

I want to subscribe to the JMS queue with no usage of EJB MDB. The reason is that I want to receive messages only when I want, but not automatically.
Is there some ways to implement it using plain Java (no Spring or smth else)?
I use WebLogic and its internal JMS provider, if it is important.
Thanks.
Yes, you should be able to connect to your JMS Queue of your Application server. JMS is a quite good standard, so after getting your Connection/Queue, the implementation is Vendor agnostic.
Here is a short overview what you have to write to create a consumer/producer with JMS: JMS Sample
This shows each step in detail with WebLogic JMS: Developing a WebLogic JMS Application
I didn't used WebLogic or it's JMS implementation, maybe you have to configure Weblogics JMS: Configuring and Managing WebLogic JMS
For a comprehensive overview of the programming capabilities of your WebLogic JMS Provider, look here: Programming WebLogic JMS

Categories