I have two JBoss EAP platform: JBoss1 and JBoss2 (different boxes and obviously different standalone configurations). In the JBoss1 server I have JMS messaging (i.e. the standalone-full.xml configuration). In the JBoss2 client I have a standalone.xml configuration. When I try to connect this environment with JBoss1 I catch an error of misplaced or needed classes (i.e. ActiveMQ Artemis core classes). In the module.xml (the descriptor of my custom lib module) I put the correct dependencies, but the error is the same. The client in JBoss2 is a simple WAR with a jboss-deployment-structure.xml. In jboss-deployment-structure.xml I don't have the same dependencies in module.xml. Is this the problem? Or the configuration of JBoss2 client must be with a standalone-full.xml?
Related
How do I connect the Web Console to an Spring Boot embedded Artemis Server ?
I have mostly followed this Answer.
tomcat 9.0.58
activemq-web-console-5.16.3.war in webapps folder
added jakarta.servlet.jsp.jstl-1.2.6.jar & jakarta.servlet.jsp.jstl-api-1.2.7.jar into webapps/activemq-web-console-5.16.3/WEB-INF/lib, otherwise the console would not start
added the line set "JAVA_OPTS=%JAVA_OPTS% -Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://localhost:61616 -Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi in catalina.bat
But now when I access the webconsole - ERROR:
I get Exception occurred while processing this request, check the log for more information!
and the logs say: IllegalStateException: No broker is found at any of the 1 configured urls
My Artemis Server is running in a minimalistic Spring Boot App:
started with VMOptions: -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
spring boot parent: spring-boot-starter-parent:2.6.2
active mq: artemis-jms-server:2.19.0
spring-boot-starter-web:2.6.2
and the following configuration class:
#Configuration
public class ArtemisConfig implements ArtemisConfigurationCustomizer {
#Autowired
private ArtemisProperties artemisProperties;
#Override
public void customize(org.apache.activemq.artemis.core.config.Configuration configuration) {
try{
configuration.setJMXManagementEnabled(true);
configuration.setSecurityEnabled(false);
configuration.addAcceptorConfiguration("netty", "tcp://localhost:" + artemisProperties.getPort());
} catch (Exception e) {
throw new RuntimeException("queue did not start");
}
}
}
The only real problem the answer you cited is that it was written for ActiveMQ "Classic" rather than ActiveMQ Artemis. ActiveMQ Artemis doesn't use activemq-web-console-5.16.3.war. It uses a web console based on Hawtio 2 which is split up across 3 different war files:
artemis-console.war
artemis-plugin.war
activemq-branding.war
Deploy these to your embedded servlet container (e.g. Tomcat, Jetty, etc.). I don't think you'll need to set any system properties, but during the release process we actually strip out any SLF4J and Log4j jar files so you may need to add those back in if your environment doesn't already provide them. We remove those jars because we actually ship SLF4J in the main lib directory of the standalone broker, and we don't actually need Log4j (since ActiveMQ Artemis uses JBoss Logging) so it's safer to remove it (especially in the wake of all the recent Log4j CVEs). See ARTEMIS-3612 for more details on that.
The web console application running in the browser communicates with the broker via Jolokia which is an HTTP-JMX bridge. Jolokia is part of the Hawtio 2 infrastructure and is included in the aforementioned war files. If the war files are being hosted in the same JVM as your Spring Boot application with ActiveMQ Artemis embedded then you should just need to point the web console app to the same server & port you're using for the console itself. If the web console is hosted separately from the Spring Boot app then you should install Jolokia and then point the web console to it.
We have a requirement for one standalone Java application that can push JMS message to a JMS queue configured on Weblogic, Websphere and JBoss application server.
Is there any generic JMS client library available, that we can use in our application for pushing the messages to any or all of these servers?
As we understand, there is a specific JMS client for each server (for e.g. wljmsclient.jar required for Weblogic target server, as we would need weblogic.jndi.WLInitialContextFactory to be available as Initial Context factory class, similarly for Websphere and JBoss). And we would like to avoid having 3 different JMS client libraries (1 each for server) in the same application.
However, the catch here is, destination server is not known during compilation time. Only during runtime, it will be known whether the given message is to be pushed to Weblogic, Websphere or JBoss server or all of them. Hence, there is a need for a deployed application to support all 3 servers during runtime.
Is there any alternative generic JMS client library?
You can develop your own client that supports the 3 servers.
Basically you need to have for your standalone application :
The different JMS provider jar on the classpath
For example a jms_config.properties file which stores the configuration for each server (initial context factory, etc.)
Then from a generic code you can build the InitialContext, JMS Queues, etc. depending on the target server.
I have application working on Jboss eap 6.3 and Hornetq queue for jms. I have to change queue from hornetq to OracleAQ. Is there any ready resource-adapter to connect it or I have to write new one for my own? I will be gratefull for any tips how can i achieve that. Thanks in advance.
As far as I know, Oracle AQ's administered JMS objects (e.g. connection factories and destinations) must be looked up via a database connection (or perhaps LDAP) rather than JNDI. Nothing shipped with JBoss EAP can do this.
I propose to check with Oracle for information regarding a JCA resource adapter that they might provide for integration with other Java EE application servers like JBoss EAP.
i'm tryin to run an app that runs on jboss EAP , on jboss Wildfly , but i'm having problems with the standalone-full.xml because some services like hornetq aren't available on Wildfly
is there a possible way to migrate from eap to wildfly?
any help?
This depends on your app.
Wildfly 10 ships with ActiveMq rather than HornetQ.
If your app uses standard JMS then you can configure the WF10 standalone-full to have the same JMS endpoints as your old deployment. If however your app is using the HornetQ specific client you will have to do some more work. ActiveMQ artemis integrates HornetQ protocols but it probably won't work without some trial and error in the configuration.
I would suggest starting with standalone-full.xml from Wildfly 10 and compare it with your JBoss EAP configuration. There should be an analog for each service you need. Once that is set try running your app and see what happens.
My j2EE app is currently running on ServiceMix. Now i want to add JMS to my app. The application should able to send/receive the JMS message to/from the queue that stays on MQSeries.
mq.hostname=10.3.6.19
mq.channel=CHANNEL
mq.queueManager=QManager
mq.port=1422
What i would like to do is:
1. Create a jndi.xml file and do configuration for jms stuff.
2. my app will initialize the context, look up jndi name, and create a connection, queueManager, queue. .etc
3. Develop send and receive methods.
My question is:
Can you tell me how to do 1st and 2nd steps.
(the script inside ServiceMix's jndi is diffrent with tomcat's
jndi and others.
ServiceMix using Spring based JNDI provider.
http://servicemix.apache.org/jndi-configuration.html)
I just ran into something similar with Weblogic. The following link uses spring-dm to integrate with websphere. It also takes it to the next logical step and adds camel to the mix.
http://lowry-techie.blogspot.com/2010/11/camel-integration-with-websphere-mq.html
Without using Spring-dm, you may run into classloader issues when trying to load the InitialContextFactory from the websphere jar (this is an issue I had with the Weblogic jar)