You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Scott Parkerson <sc...@gmail.com> on 2010/01/07 19:38:04 UTC

Accessing stats on ActiveMQ in Latest ServiceMix 4 (FUSE ESB 4.1 RC1)

Greetings, all.

I tried checking the stats on the embedded ActiveMQ in the latest
ServiceMix 4, and I'm getting odd responses back from activemq:query:

karaf@root> activemq:query
null
karaf@root> activemq:query -QTopic=* --view EnqueueCount,DequeueCount
Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
ERROR: java.lang.RuntimeException: Failed to execute query task.
Reason: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.NameNotFoundException: jmxrmi
java.lang.RuntimeException: Failed to execute query task. Reason:
java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.NameNotFoundException: jmxrmi
        at org.apache.activemq.console.command.QueryCommand.runTask(QueryCommand.java:120)
        at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJmxCommand.java:292)
        at org.apache.servicemix.activemq.commands.ActiveMQCommandSupport.doExecute(ActiveMQCommandSupport.java:48)
        at org.apache.felix.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:41)
        at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:34)
        at org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:45)
        at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:211)
        at org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:146)
        at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:91)
        at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:75)
        at org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
        at org.apache.felix.karaf.shell.console.jline.Console.run(Console.java:174)
        at java.lang.Thread.run(Thread.java:619)
java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.NameNotFoundException: jmxrmi

Not sure what is wrong, other than (perhaps) the RMI stuff is busted.

Also, isn't there supposed to be a web console for ActiveMQ in the
latest ServiceMix (as well as a web console for ServiceMix in
general)? Not sure where I heard that from.

--sgp

Re: Accessing stats on ActiveMQ in Latest ServiceMix 4 (FUSE ESB 4.1 RC1)

Posted by Eoghan Glynn <eo...@gmail.com>.
Hi Scott,

The activemq:query command is implemented by AMQ and still uses
"service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi" as the default JMX
URL.

Whereas since the switch-over to karaf, SMX4 itself now exposes a JMX
connector with a different URL, having the context changed from "jmxrmi" to
"karaf-<instance_name>" (i.e. "karaf-root" in general).

So to use the activemq:query command, you'll simply need to specify the
correct JMX details as follows:

karaf@root> activemq:query --jmxurl
service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root --jmxuser karaf
--jmxpassword karaf -QTopic=* --view EnqueueCount,DequeueCount

Alternatively just use the --jmxlocal option to indicate that the local (as
opposed to potentially remote) MBeanServer should be used, i.e.:

karaf@root> activemq:query --jmxlocal -QTopic=* --view
EnqueueCount,DequeueCount

Both approaches worked fine for me in an ESB RC1 kit.

Cheers,
Eoghan


2010/1/7 Scott Parkerson <sc...@gmail.com>

> Greetings, all.
>
> I tried checking the stats on the embedded ActiveMQ in the latest
> ServiceMix 4, and I'm getting odd responses back from activemq:query:
>
> karaf@root> activemq:query
> null
> karaf@root> activemq:query -QTopic=* --view EnqueueCount,DequeueCount
> Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
> ERROR: java.lang.RuntimeException: Failed to execute query task.
> Reason: java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NameNotFoundException: jmxrmi
> java.lang.RuntimeException: Failed to execute query task. Reason:
> java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NameNotFoundException: jmxrmi
>        at
> org.apache.activemq.console.command.QueryCommand.runTask(QueryCommand.java:120)
>        at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>        at
> org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJmxCommand.java:292)
>        at
> org.apache.servicemix.activemq.commands.ActiveMQCommandSupport.doExecute(ActiveMQCommandSupport.java:48)
>        at
> org.apache.felix.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:41)
>        at
> org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:34)
>        at
> org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:45)
>        at
> org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:211)
>        at
> org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:146)
>        at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:91)
>        at
> org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:75)
>        at
> org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
>        at
> org.apache.felix.karaf.shell.console.jline.Console.run(Console.java:174)
>        at java.lang.Thread.run(Thread.java:619)
> java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NameNotFoundException: jmxrmi
>
> Not sure what is wrong, other than (perhaps) the RMI stuff is busted.
>
> Also, isn't there supposed to be a web console for ActiveMQ in the
> latest ServiceMix (as well as a web console for ServiceMix in
> general)? Not sure where I heard that from.
>
> --sgp
>

Re: Accessing stats on ActiveMQ in Latest ServiceMix 4 (FUSE ESB 4.1 RC1)

Posted by Charles Moulliard <cm...@gmail.com>.
Have you tried to provide the following parameter ?

Task Usage: Main browse --amqurl <broker url> [browse-options]
<destinations>
Description: Display selected destination's messages.

Browse Options:
    --amqurl <url>                Set the broker URL to connect to.
    --msgsel <msgsel1,msglsel2>   Add to the search list messages matched by
the query similar to
                                  the messages selector format.
    -V<header|custom|body>        Predefined view that allows you to view
the message header, custom
                                  message header, or the message body.
    --view <attr1>,<attr2>,...    Select the specific attribute of the
message to view.
    --version                     Display the version information.
    -h,-?,--help                  Display the browse broker help
information.

Examples:
    Main browse --amqurl tcp://localhost:61616 FOO.BAR
        - Print the message header, custom message header, and message body
of all messages in the
          queue FOO.BAR

    Main browse --amqurl tcp://localhost:61616 -Vheader,body queue:FOO.BAR
        - Print only the message header and message body of all messages in
the queue FOO.BAR

    Main browse --amqurl tcp://localhost:61616 -Vheader --view
custom:MyField queue:FOO.BAR
        - Print the message header and the custom field 'MyField' of all
messages in the queue FOO.BAR

    Main browse --amqurl tcp://localhost:61616 --msgsel
JMSMessageID='*:10',JMSPriority>5 FOO.BAR
        - Print all the message fields that has a JMSMessageID in the header
field that matches the
          wildcard *:10, and has a JMSPriority field > 5 in the queue
FOO.BAR
        * To use wildcard queries, the field must be a string and the query
enclosed in ''



Regards,
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm


On Fri, Jan 15, 2010 at 2:09 AM, boday <bo...@vektrel.com> wrote:

>
> Charles,
>
> I'm seeing the same issue as Scott and tried the suggestions you mentioned
> (on out of the box Fuse ESB 4.1.0-psc-01-00RC1)...no luck.
>
> The "activemq:list/query/browse" commands all return "null"...is this
> expected?  Do I have to do anything to "install" activemq?
>
> I fired up jConsole and can see the ActiveMQ broker is available at
> tcp://<machine-name>:61616...
>
> thanks
>
>
>
> -----
> Ben - Senior Consultant
> using SMX 3.3.1/Camel 2.1
> --
> View this message in context:
> http://old.nabble.com/Accessing-stats-on-ActiveMQ-in-Latest-ServiceMix-4-%28FUSE-ESB-4.1-RC1%29-tp27064840p27170901.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>

Re: Accessing stats on ActiveMQ in Latest ServiceMix 4 (FUSE ESB 4.1 RC1)

Posted by boday <bo...@vektrel.com>.
Charles,

I'm seeing the same issue as Scott and tried the suggestions you mentioned
(on out of the box Fuse ESB 4.1.0-psc-01-00RC1)...no luck.  

The "activemq:list/query/browse" commands all return "null"...is this
expected?  Do I have to do anything to "install" activemq?

I fired up jConsole and can see the ActiveMQ broker is available at
tcp://<machine-name>:61616...

thanks



-----
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: http://old.nabble.com/Accessing-stats-on-ActiveMQ-in-Latest-ServiceMix-4-%28FUSE-ESB-4.1-RC1%29-tp27064840p27170901.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Accessing stats on ActiveMQ in Latest ServiceMix 4 (FUSE ESB 4.1 RC1)

Posted by Charles Moulliard <cm...@gmail.com>.
Hi Scott,

I think that the JMX parameters used to connect to ActiveMQ are wrong.  This
is why you cannot retrieve the stats.

Can you check that you can connect to your activemq server through Java
Jconsole ?

Can you check the following params in the file etc/system.properties or osgi
config admin ?

1) Config admin :

using command --> config:list

Pid:            org.apache.felix.karaf.management
BundleLocation: null
Properties:
   threaded = true
   serviceUrl = service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
   service.pid = org.apache.felix.karaf.management
   objectName = connector:name=rmi
   jmxRealm = karaf
   daemon = true
   felix.fileinstall.filename = org.apache.felix.karaf.management.cfg
   rmiRegistryPort = 1099

2) system.properties

# ActiveMq Web Console properties
webconsole.type=properties
webconsole.jms.url=tcp://localhost:61616
webconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
webconsole.jmx.user=karaf
webconsole.jmx.password=karaf


Regards,


Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm


On Wed, Jan 13, 2010 at 7:36 PM, Scott Parkerson
<sc...@gmail.com>wrote:

> On 01/08/2010 05:18 AM, Charles Moulliard wrote:
>
>> Hi Scott,
>>
>> You can deploy the ActiveMq console very easily on SMX4. Here is the step
>> by
>> step process :
>> [snip]
>>
>
> Thanks, Charles... any idea on what could be going wrong with the stats
> view in Karaf?
>
> --sgp
>
>

Re: Accessing stats on ActiveMQ in Latest ServiceMix 4 (FUSE ESB 4.1 RC1)

Posted by Scott Parkerson <sc...@gmail.com>.
On 01/08/2010 05:18 AM, Charles Moulliard wrote:
> Hi Scott,
>
> You can deploy the ActiveMq console very easily on SMX4. Here is the step by
> step process :
> [snip]

Thanks, Charles... any idea on what could be going wrong with the stats 
view in Karaf?

--sgp


Re: Accessing stats on ActiveMQ in Latest ServiceMix 4 (FUSE ESB 4.1 RC1)

Posted by Charles Moulliard <cm...@gmail.com>.
Hi Scott,

You can deploy the ActiveMq console very easily on SMX4. Here is the step by
step process :

1) Install required bundles

a) PAX URL WAR extension used to deploy a WAR file top of SMX4
osgi:install -s mvn:org.ops4j.pax.url/pax-url-war/1.1.2

b) PAX Web bundles required for OSGI WebContainer
osgi:install -s mvn:org.ops4j.pax.web/pax-web-api/0.7.1
osgi:install -s mvn:org.ops4j.pax.web/pax-web-spi/0.7.1
osgi:install -s mvn:org.ops4j.pax.web/pax-web-runtime/0.7.1
osgi:install -s mvn:org.ops4j.pax.web/pax-web-jetty/0.7.1
osgi:install -s mvn:org.ops4j.pax.web/pax-web-jsp/0.7.1
osgi:install -s mvn:org.ops4j.pax.web/pax-web-extender-war/0.7.1
osgi:install -s mvn:org.ops4j.pax.web/pax-web-extender-whiteboard/0.7.1

2) Install the ActiveMq WAR file
osgi:install -s
war:mvn:org.apache.activemq/activemq-web-console/5.3.0/war?Webapp-Context=activemqweb&Bundle-Classpath=.,WEB-INF/tags/for
m,WEB-INF/tags/jms

More info about that can be find on my blog :
http://cmoulliard.blogspot.com/2009/03/trick-to-customize-war-deployment-on.html

3) Connect to the browser through the Browser
http://localhost:8181/activemqweb

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm


On Thu, Jan 7, 2010 at 7:38 PM, Scott Parkerson
<sc...@gmail.com>wrote:

> Greetings, all.
>
> I tried checking the stats on the embedded ActiveMQ in the latest
> ServiceMix 4, and I'm getting odd responses back from activemq:query:
>
> karaf@root> activemq:query
> null
> karaf@root> activemq:query -QTopic=* --view EnqueueCount,DequeueCount
> Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
> ERROR: java.lang.RuntimeException: Failed to execute query task.
> Reason: java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NameNotFoundException: jmxrmi
> java.lang.RuntimeException: Failed to execute query task. Reason:
> java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NameNotFoundException: jmxrmi
>        at
> org.apache.activemq.console.command.QueryCommand.runTask(QueryCommand.java:120)
>        at
> org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
>        at
> org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJmxCommand.java:292)
>        at
> org.apache.servicemix.activemq.commands.ActiveMQCommandSupport.doExecute(ActiveMQCommandSupport.java:48)
>        at
> org.apache.felix.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:41)
>        at
> org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:34)
>        at
> org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:45)
>        at
> org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:211)
>        at
> org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:146)
>        at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:91)
>        at
> org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:75)
>        at
> org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
>        at
> org.apache.felix.karaf.shell.console.jline.Console.run(Console.java:174)
>        at java.lang.Thread.run(Thread.java:619)
> java.io.IOException: Failed to retrieve RMIServer stub:
> javax.naming.NameNotFoundException: jmxrmi
>
> Not sure what is wrong, other than (perhaps) the RMI stuff is busted.
>
> Also, isn't there supposed to be a web console for ActiveMQ in the
> latest ServiceMix (as well as a web console for ServiceMix in
> general)? Not sure where I heard that from.
>
> --sgp
>