Mule 3.7CE enabling jmx - mule

i'm trying to get JMX monitoring to work on a Mule 3.7 CE server.
I've got a flow with
<management:jmx-server >
<management:connector-server url="service:jmx:rmi:///jndi/rmi://my-server:1099/server" rebind="false" />
</management:jmx-server>
when i deploy the app it get this error
Failed to deploy artifact 'jmx_ce37', see below +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ org.mule.module.launcher.DeploymentInitException:
RegistrationException: More than one object of type class
org.mule.module.management.agent.AbstractJmxAgent registered but only
one expected. at
org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:197)
~[?:?]
I would assume that there's already some jmx process running; but i didn't enable it, and i don't know how to connect to it. There are no processes listening on the default jmx port (1096) on this machine.
Any suggestions on what to do to use jmx with Mule3.7CE ?

Mule server already provides indeed a JMX server with basic statistics around the server and the applications, please try and use a different port if the default out-of-the-box behaviuor does not work for you.

Related

JMX Connection to Mule 4 Project running Locally

How do you connect a JMX agent to a Mule 4 project running locally? When I launch JConsole I see two mule-related processes called org.mule.runtime.module.reboot.MuleContainerBootstrap but I cannot connect to either.
I've tried running my project with the following flags and connecting remotely:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1096
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.host=localhost
But no luck.
I had no problems connecting to (localhost:1096) using just these properties:
-Dcom.sun.management.jmxremote.port=1096
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
JConsole gave me a warning about the insecure connection (no SSL). I accepted to connect insecurely and that was enough.
However when adding -Dcom.sun.management.jmxremote.host=localhost is keeps failing to connect. This looks like a Java issue.
If you only want to ensure local connections you can replace it with -Dcom.sun.management.jmxremote.local.only=true which should give you the expected result.
Having said that, this is all a pure Java JMX topic. Mule 4 doesn't expose any MBeans over JMX like Mule 3 did so there is no specific reason to connect with JMX.
I'm not sure why you are using jconsole given that VisualVM is a much modern and powerful alternative, unless you are just testing the local JMX connectivity ;-)

Mule ESB WebsphereMQ connection with JMS connector works in Mule Design, but not standalone server

I am new to Mule and followed this blog to create a "websphere-mq connector" through the jms connector. I am using the community edition.
In order to connect to the websphere mq server, I must run the application under a specific Windows username. Running the mule application in Mule Design under the specific username, I am able to connect and receive messages. However, I am unable to connect to the websphere mq server through the standalone application running on a windows server. I changed the user on the service that is running mule to the specific user but am unable to get authorization to the websphere mq server.
Any additional insight would be much appreciated.
I would suggest reviewing the "Getting going without turning off security" article for an introduction to MQ security. This might help get the MQ system correctly configured.
The stand alone application runs the Tanuki Software wrapper as the user assigned to the environment variable %USERNAME% in windows. Even though I updated the user in the Mule service to run as the approved user, the wrapper will take the environment variable.
To solve the problem, I updated the wrapper.conf file to include the following:
set.USERNAME=<approvedUsername>
the environment variable %USERNAME% is now set to the approved username, in which mule will allow the JMS connector to the authenticate with the correct username.

How to use GFSH to connect peer to peer environment?

I am running Gemfire HTTP session management model within my application as P2P on a WebSphere. I can see the session logs on WAS. However, I could not find a way to connect it through gfsh from my desktop. I am using default seeting without locator. I would like to monitor Gemfire status, how?
Cache_Peer.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cache PUBLIC
"-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
"http://www.gemstone.com/dtd/cache6_6.dtd">
<cache>
<!-- This is the definition of the default session region -->
<region name="gemfire_modules_sessions">
<region-attributes scope="distributed-ack" enable-gateway="false" data-policy="replicate" statistics-enabled="false">
</region-attributes>
</region>
</cache>
As mentioned by Jens, Locator by defaults is a JMX manager. Any locator can become a JMX Manager when started. When you start up a locator, if no other JMX Manager is detected in the distributed system, the locator starts one automatically. If you start a second locator, it will detect the current JMX Manager and will not start up another JMX Manager unless the second locator's gemfire.jmx-manager-start property is set to true.
To turn any other member (p2p server) to JMX manager, set jmx-manager=true and jmx-manager-start=true in the server's gemfire.properties file.
To start the member as a JMX Manager node on the command line, provide --J=-Dgemfire.jmx-manager-start=true and --J=-Dgemfire.jmx-manager=true as arguments to either the start server command.
For example, to start a server as a JMX Manager on the gfsh command line:
gfsh>start server --name=<server-name> --J=-Dgemfire.jmx-manager=true \
--J=-Dgemfire.jmx-manager-start=true
Refer http://gemfire80.docs.pivotal.io/7.0.2/userguide/index.html#managing/management/jmx_manager_operations.html for more details.
By default, the locator in a client-server environment, would be a JMX manager. In a p2p setup you need to enable the JMX manager in one of your servers. You can do this by setting the GemFire properties: jmx-manager-enable=true and jmx-manager-start=true. It is also possible to have multiple JMX managers. If your p2p setup only consists of 2 servers, then having both be JMX managers would be OK.
You can use connect command from gfsh, it connects to the jmx manager.
If you have locator, then connect it using connect --locator=host[port] command, the jmx-manager automatically starts on locator. However, if you don't have locator, then you need to explicitly start jmx-manager on servers and connect it using connect --jmx-manager=host[port] command.
Refer http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/gfsh/command-pages/connect.html for more details.
If the Gemfire cluster is running behind firewall, then use HTTP to connect, refer http://gemfire.docs.pivotal.io/latest/userguide/index.html#deploying/gfsh/gfsh_remote.html

How to connect to JMX service on Glassfish from within an EJB?

I have a message-driven EJB deployed to a Glassfish 2.x system. When I get a message that causes an exception or isn't able to be sent or consumed, I would like to do one of the following things:
Pause the EJB's subscription to the Topic/Queue
Shut down the EJB itself
Cease consuming messages until I give an 'all clear' or something equivalent
This is all so that I can stop repeatedly throwing exceptions after calling context.setRollbackOnly() on the message.
I've tried connecting to the server via JMX, but from what I've looked at in documentation says that I'd have to persist:
username
password
jmx url
in my EJB somewhere. Can't I access the JMX server from within the EJB in Glassfish without having to know that?

Setting up WebSphere MQ integration in a WebLogic clustered environment

I have a WebLogic cluster up and running an application containing an MDB. I'm currently using WebLogic JMS queues to send messages to the MDB. All is well.
I now have need to switch to IBM WebSphere MQ for my JMS messaging.
I can set this up and send/receive messages in a non-clustered environment (Admin server) using a Foreign server with a bindings file. However, I can't seem to properly configure the clustered environment for MQ integration to work correctly.
I get the following when deploying the EAR/MDB on the cluster:
The Message-Driven EJB: xxxMDB is unable to connect to the JMS destination...
javax.naming.NameNotFoundException: Unable to resolve 'jms.xxxQueue'
Can anyone point me to some documentation on how to configure IBM WebSphere MQ in a WebLogic cluster?
Thanks!
there is a need to add several MQ JMS classes to the PATH of the weblogic so it will be able to connect to MQ
the path needed to be added is : *MQ_system_path*/java/lib64
beside that here are the clasess i have found that are needed to make this thing :
com.ibm.mq.mqi.jar; com.ibm.mq.headers.jar; com.ibm.mq.jar; commonservices.jar; com.ibm.mq.jms.jar;jta.jar;
this what helped us to connect weblogic to MQ
regards
Oren yeger