Re: Pure JMS management
It seems to work well for me. I'll run a full build and will create a PR. 2017-05-19 8:03 GMT+02:00 Guillaume Nodet <gno...@apache.org>: > I'm enhancing a layer in OSGi to support Artemis, and I'd like to avoid > adding package dependencies. > That's why I'm using the connection's classloader to load the needed > class, as it's not available from the class which defines this code. > > To refine my question further: could the reply be typed as a text message > rather than not typed ? This would allow retrieving the json body as a > string. > Basically, I'm proposing the following patch: > > *--- > a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java* > > *+++ > b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java* > > @@ -370,6 +370,7 @@ public class ManagementServiceImpl implements > ManagementService { > >message = message.toCore(); > >// a reply message is sent with the result stored in the message > body. > >CoreMessage reply = new CoreMessage(storageManager.generateID(), > 512); > > + reply.setType(Message.TEXT_TYPE); > >reply.setReplyTo(message.getReplyTo()); > > > >String resourceName = message.getStringProperty( > ManagementHelper.HDR_RESOURCE_NAME); > > > 2017-05-19 3:10 GMT+02:00 Clebert Suconic <clebert.suco...@gmail.com>: > >> @Tim Bain: yes.. Artemis from what I see on the class Names (I also >> spoke to him gnodet on the IRC channel earlier today). >> >> @gnodet: I am not understanding why you would need to use reflection. >> You can just simply use JMSManagementHelper directly. they are all >> static methods... >> >> >> This example here, part of distribution under >> examples/features/standard/management shows how it was intended to be >> used: >> >> >> https://github.com/apache/activemq-artemis/blob/master/examp >> les/features/standard/management/src/main/java/org/apache/ac >> tivemq/artemis/jms/example/ManagementExample.java >> >> >> >> Maybe I"m misunderstanding your question? >> >> On Thu, May 18, 2017 at 6:23 PM, Guillaume Nodet <gno...@apache.org> >> wrote: >> > I'm trying do perform management operation with pure JMS api. >> > To retrieve the list of queues, I'm currently using the following code: >> > >> > QueueSession session = ((QueueConnection) >> > connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE); >> > Queue managementQueue = session.createQueue("activemq.management"); >> > QueueRequestor requestor = new QueueRequestor(session, managementQueue); >> > connection.start(); >> > TextMessage m = session.createTextMessage(); >> > m.setStringProperty("_AMQ_ResourceName", "broker"); >> > m.setStringProperty("_AMQ_OperationName", "getQueueNames"); >> > m.setText("[\"" + routing + "\"]"); >> > Message reply = requestor.request(m); >> > Class mgmtHelperClass = >> > connection.getClass().getClassLoader().loadClass("org.apache >> .activemq.artemis.api.jms.management.JMSManagementHelper"); >> > Method getResultsMethod = mgmtHelperClass.getMethod("getResults", >> > Message.class); >> > Object[] results = (Object[]) getResultsMethod.invoke(null, reply); >> > List names = new ArrayList<>(); >> > for (Object o : (Object[]) (results[0])) { >> > names.add(o.toString()); >> > } >> > return names; >> > >> > >> > It works, but I think I should not have to use reflection to access the >> > result message, hence the use of reflection to access the >> > JMSManagementHelper methods. >> > It seems to me the reply should be of type TextMessage, but it's >> currently >> > untyped, so I can't use TextMessage#getText to retrieve the json result, >> > and I can't find a way to retrieve it another way. >> > Do I miss anything ? >> > >> > -- >> > >> > Guillaume Nodet >> >> >> >> -- >> Clebert Suconic >> > > > > -- > > Guillaume Nodet > > -- Guillaume Nodet
Re: Pure JMS management
I'm enhancing a layer in OSGi to support Artemis, and I'd like to avoid adding package dependencies. That's why I'm using the connection's classloader to load the needed class, as it's not available from the class which defines this code. To refine my question further: could the reply be typed as a text message rather than not typed ? This would allow retrieving the json body as a string. Basically, I'm proposing the following patch: *--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java* *+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java* @@ -370,6 +370,7 @@ public class ManagementServiceImpl implements ManagementService { message = message.toCore(); // a reply message is sent with the result stored in the message body. CoreMessage reply = new CoreMessage(storageManager.generateID(), 512); + reply.setType(Message.TEXT_TYPE); reply.setReplyTo(message.getReplyTo()); String resourceName = message.getStringProperty(ManagementHelper.HDR_RESOURCE_NAME); 2017-05-19 3:10 GMT+02:00 Clebert Suconic <clebert.suco...@gmail.com>: > @Tim Bain: yes.. Artemis from what I see on the class Names (I also > spoke to him gnodet on the IRC channel earlier today). > > @gnodet: I am not understanding why you would need to use reflection. > You can just simply use JMSManagementHelper directly. they are all > static methods... > > > This example here, part of distribution under > examples/features/standard/management shows how it was intended to be > used: > > > https://github.com/apache/activemq-artemis/blob/master/examp > les/features/standard/management/src/main/java/org/apache/ > activemq/artemis/jms/example/ManagementExample.java > > > > Maybe I"m misunderstanding your question? > > On Thu, May 18, 2017 at 6:23 PM, Guillaume Nodet <gno...@apache.org> > wrote: > > I'm trying do perform management operation with pure JMS api. > > To retrieve the list of queues, I'm currently using the following code: > > > > QueueSession session = ((QueueConnection) > > connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE); > > Queue managementQueue = session.createQueue("activemq.management"); > > QueueRequestor requestor = new QueueRequestor(session, managementQueue); > > connection.start(); > > TextMessage m = session.createTextMessage(); > > m.setStringProperty("_AMQ_ResourceName", "broker"); > > m.setStringProperty("_AMQ_OperationName", "getQueueNames"); > > m.setText("[\"" + routing + "\"]"); > > Message reply = requestor.request(m); > > Class mgmtHelperClass = > > connection.getClass().getClassLoader().loadClass("org. > apache.activemq.artemis.api.jms.management.JMSManagementHelper"); > > Method getResultsMethod = mgmtHelperClass.getMethod("getResults", > > Message.class); > > Object[] results = (Object[]) getResultsMethod.invoke(null, reply); > > List names = new ArrayList<>(); > > for (Object o : (Object[]) (results[0])) { > > names.add(o.toString()); > > } > > return names; > > > > > > It works, but I think I should not have to use reflection to access the > > result message, hence the use of reflection to access the > > JMSManagementHelper methods. > > It seems to me the reply should be of type TextMessage, but it's > currently > > untyped, so I can't use TextMessage#getText to retrieve the json result, > > and I can't find a way to retrieve it another way. > > Do I miss anything ? > > > > -- > > > > Guillaume Nodet > > > > -- > Clebert Suconic > -- Guillaume Nodet
Pure JMS management
I'm trying do perform management operation with pure JMS api. To retrieve the list of queues, I'm currently using the following code: QueueSession session = ((QueueConnection) connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue managementQueue = session.createQueue("activemq.management"); QueueRequestor requestor = new QueueRequestor(session, managementQueue); connection.start(); TextMessage m = session.createTextMessage(); m.setStringProperty("_AMQ_ResourceName", "broker"); m.setStringProperty("_AMQ_OperationName", "getQueueNames"); m.setText("[\"" + routing + "\"]"); Message reply = requestor.request(m); Class mgmtHelperClass = connection.getClass().getClassLoader().loadClass("org.apache.activemq.artemis.api.jms.management.JMSManagementHelper"); Method getResultsMethod = mgmtHelperClass.getMethod("getResults", Message.class); Object[] results = (Object[]) getResultsMethod.invoke(null, reply); List names = new ArrayList<>(); for (Object o : (Object[]) (results[0])) { names.add(o.toString()); } return names; It works, but I think I should not have to use reflection to access the result message, hence the use of reflection to access the JMSManagementHelper methods. It seems to me the reply should be of type TextMessage, but it's currently untyped, so I can't use TextMessage#getText to retrieve the json result, and I can't find a way to retrieve it another way. Do I miss anything ? -- Guillaume Nodet
Re: jaasAuthenticationPlugin in osgi
JAAS does not work in OSGi. You need to use a specific integration layer in order to make that work. We've done that in Karaf, but not sure how easy it would be to port it in Virgo. But that's more a question for the Virgo guys rather than ActiveMQ, as ActiveMQ has nothing do fix in that area. On Thu, Mar 17, 2011 at 11:00, JacobS jacobhame...@gmail.com wrote: Hi, acme.security.MyLoginModule is my implementation of the LoginModule interface it is not a misconfiguration. btw this implementation worked fine when used not as an osgi service. This is my config file: ActiveMQ { acme.security.MyLoginModule required debug=true; }; -- View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3384078.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: jaasAuthenticationPlugin in osgi
See http://karaf.apache.org/manual/2.2.0/developers-guide/security-framework.html and the code is at http://svn.apache.org/viewvc/karaf/tags/karaf-2.2.0/jaas/ On Thu, Mar 17, 2011 at 13:58, JacobS jacobhame...@gmail.com wrote: Can you elaborate about integration layer for karaf, maybe I can use that in virgo, where can I find some documentation on that ? -- View this message in context: http://activemq.2283324.n4.nabble.com/jaasAuthenticationPlugin-in-osgi-tp3383955p3384425.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: Karaf + ActiveMQ
You should be able to deploy the activemq core bundle without too much problems. The commands for activemq that are part of servicemix can't be easily deployed, unless you use the latest snapshots. So use karaf 1.0 + activemq 5.3, and if you really need the commands, grab the latest servicemix snapshots for those bundles. On Tue, Nov 10, 2009 at 11:41, Markus Wolf markus.w...@nmmn.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, I'm struggeling to deploy ActiveMQ on Karaf 1.0. The problem I have is that the ActiveMQ bundles depend on the Geronimo GShell which is not in the features listed here mvn:org.apache.servicemix/apache-servicemix/4.0.0/xml/features. And when I tried to add the required bundles manually I noticed that the GSheel depends on com.google.code.sshd:sshd:bundle:0.1 instead of the Mina SSHD implementation. This is all a bit hairy and hard to install. Is there an up-to-date tutorial or documentation on how to do this? Thanks in advance Markus Wolf - -- NMMN - New Media Markets Networks GmbH Langbehnstrasse 6, 22761 Hamburg Geschäftsführung: Kfm. Michael Schütt Finanzamt HH-Altona - UStID DE 812 699 852 - HRB 71102 Hamburg HypoVereinsbank - BLZ 200 300 00 - Konto-Nr. 156 29 82 http://www.nmmn.com Tel.: +49 40 284 118-0 - Fax: +49 40 284118-999 Softwareentwicklung LLynch: -720 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkr5Q3EACgkQDBHISU1oEKGNpQCgpG8wyZ0ZCXGMo2ya4bJGVCRc PFEAoJ1rqRVHT7qSJjUIt9yY2pPLT/x4 =Pd9R -END PGP SIGNATURE- -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: ActiveMQ + OSGI
On Fri, Apr 3, 2009 at 10:47, ffrenchm ffrench.mathi...@gmail.com wrote: Hello, I've some questions about ActiveMQ and OSGI. As far as I know, there is two activemq jar bundlised : activemq-core and activemq-pool. Is there any others ActiveMQ bundlised jars today ? All ActiveMQ jars are OSGi bundles. The other question I've is about the activemq bundleisation methodology. I already see that you use pom.xml to define your dependencies. I would like to know what kind of bundlisation tools is behind properties such as activemq.osgi.import.pkg. Do you use a tool like bnd for example ? Yes, those properties are defined in the root pom where the maven-bundle-plugin configuration is defined. My aim is to integrate ActiveMQ bundle on Felix. I know this is already done on servicemix 4 but through their servicemix kernel (felix + others OSGI tools). Is there anybody who try to make it work directly on native felix ? Do you have any advices for me ? Just deploy the jars and the required dependencies. You'll find the list in ServiceMix 4 feature definition for ActiveMQ at http://repo1.maven.org/maven2/org/apache/servicemix/apache-servicemix/4.0.0/apache-servicemix-4.0.0-features.xml I advise you to use the same bundles as listed or you'll likely run into issues. Thanks -- View this message in context: http://www.nabble.com/ActiveMQ-%2B-OSGI-tp22864414p22864414.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: JMS pooling... pool package in activeMQ
The block synchronizes on the message producer, which means it's here in case the *same* producer is used from several different threads, so it should not have much overhead when using multiple producers (which would be recommand afaik). For the pooling part, the first thing is that consuming messages and pooling is quite incompatible usually. The main problem is that if you keep unused consumers alive, messages can be waiting on the consumer and thus never be actually delivered (if you don't consumer those messages or close the consumer). For session / producer pooling, you should be free to use the pooled connection factory. On Tue, Feb 3, 2009 at 15:55, soody atins...@gmail.com wrote: I am working on JMS pooling and have a few doubts 1)I was going through the pool package of ActiveMQ. In PooledMessageProducer we have s.th like // just in case let only one thread send at once synchronized (messageProducer) { messageProducer.send(destination, message, deliveryMode, priority, timeToLive); } in the send method. I am not sure why we need to have the send synchronized. AS far as I understand we can use as many producers from a session and send msgs in parallel from them to the same destination Only thing that can get messed up is there will be no order in which these msgs are sent. But I guess when we decided to use multiple threads to send msgs we have anyways made our choice to drop the sequencing order. 2)Also there has been much discussion the pooling thing but there is nothing concrete. I guess for any JMS client we can write a wrapper around the PooledConnectionFactory and other classes and make sure that we have a number of connections and a pool of sessions associated with it. We can use these for pooling. Does it make any diff if we use this for producing or consumption of msgs. Please note I am talking about a standalone JMS Client, no springs included and a pretty generic client that can work with any JMS provider. -- View this message in context: http://www.nabble.com/JMS-pooling...-pool-package-in-activeMQ-tp21811493p21811493.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: JMS pooling... pool package in activeMQ
order. 2)Also there has been much discussion the pooling thing but there is nothing concrete. I guess for any JMS client we can write a wrapper around the PooledConnectionFactory and other classes and make sure that we have a number of connections and a pool of sessions associated with it. We can use these for pooling. Does it make any diff if we use this for producing or consumption of msgs. Please note I am talking about a standalone JMS Client, no springs included and a pretty generic client that can work with any JMS provider. -- View this message in context: http://www.nabble.com/JMS-pooling...-pool-package-in-activeMQ-tp21811493p21811493.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com -- View this message in context: http://www.nabble.com/JMS-pooling...-pool-package-in-activeMQ-tp21811493p21817781.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: ActiveMQ and SMX4
On Tue, Aug 26, 2008 at 4:48 PM, Yari Marchetti [EMAIL PROTECTED] wrote: Hello, we are planning to use ActiveMQ in a production environment, but we need to be able to change configuration while the broker is running. I took a look at ServiceMix 4 and it seems to suit perfectly to our needs (moreover it implements other interesting things), allowing ActiveMQ to reload its configuration by just modifying activemq.xml. I tried to install a binary distribution and it didn't work well with ActiveMQ (i wasn't able to start any broker, because it kept saying it couldn't deploy it), then i tried using a snapshot from snv, and it worked very well: i was able to change ActiveMQ configuration while the broker was running. Yes, IIRC, some modifications were needed to make sure everything works correctly. So ActiveMQ 5.2-SNAPSHOT is currently required. Now my question is: how does ActiveMQ and SMX4 work together? how is the integration? SMX4 is built on top of Apache Felix, an OSGi container. A lot of work has been done to be able to make ActiveMQ and its required components work nicely in OSGi. Aside from the JMS broker, the SMX4/AMQ integration provides a bunch of commands that you can use from the ActiveMQ console. ActiveMQ is bundled inside the full SMX4 distribution, but if you don't need the JBI layer, you could grab a ServiceMix Kernel and just install the needed bundles instead. Let me know if you want more informations. We plan to use Camel as well, and reading from: http://activemq.apache.org/camel/jbi.html seems that it should work pretty well with SMX4. did anyone tried it? Yes. Camel nicely integrates in SMX4. In the SMX4 distribution, there are a few examples that shows the use of Camel. greetings, Yari -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/
Re: ActiveMQ and SMX4
ServiceMix distribution includes ActiveMQ and Camel, while the ActiveMQ distribution includes Camel. The ServiceMix Kernel is an enhanced OSGi based runtime that does not include the JBI layer, ActiveMQ or Camel, but they can be very easily deployed on to it. On Tue, Aug 26, 2008 at 5:01 PM, Powers, Matthew [EMAIL PROTECTED] wrote: I thought that ServiceMix ran off of AtvieMQ and was included in the release. -Original Message- From: Yari Marchetti [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 10:49 AM To: users@activemq.apache.org Subject: ActiveMQ and SMX4 Hello, we are planning to use ActiveMQ in a production environment, but we need to be able to change configuration while the broker is running. I took a look at ServiceMix 4 and it seems to suit perfectly to our needs (moreover it implements other interesting things), allowing ActiveMQ to reload its configuration by just modifying activemq.xml. I tried to install a binary distribution and it didn't work well with ActiveMQ (i wasn't able to start any broker, because it kept saying it couldn't deploy it), then i tried using a snapshot from snv, and it worked very well: i was able to change ActiveMQ configuration while the broker was running. Now my question is: how does ActiveMQ and SMX4 work together? how is the integration? We plan to use Camel as well, and reading from: http://activemq.apache.org/camel/jbi.html seems that it should work pretty well with SMX4. did anyone tried it? greetings, Yari -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/
Re: CONFUSED!?!? What is the released version now?
Look at the warning box at the top of the 5.1.0 release page: it says the release is still in progress. On Sun, Apr 27, 2008 at 6:24 AM, sparky2708 [EMAIL PROTECTED] wrote: What is the release version of ActiveMQ at this point? 5.0.0 or 5.1.0? On the download page: http://activemq.apache.org/download.html It says: The latest stable release is the ActiveMQ 5.0.0 Release And then follows the list of downloads (notice the 1st one): * ActiveMQ 5.1.0 Release * ActiveMQ 4.1.2 Release * ActiveMQ 5.0.0 Release * ActiveMQ 4.1.1 Release * ActiveMQ 4.1.0 Release * ActiveMQ 4.0.2 Release * ActiveMQ 4.0.1 Release * ActiveMQ 4.0 Release * ActiveMQ 4.0 RC2 Release * ActiveMQ 4.0 M4 Release * ActiveMQ 3.2.2 Release * ActiveMQ 3.2.1 Release * ActiveMQ 3.2 Release * ActiveMQ 3.1 Release * ActiveMQ 3.0 Release * ActiveMQ 2.1 Release * ActiveMQ 2.0 Release * ActiveMQ 1.5 Release * ActiveMQ 1.4 Release * ActiveMQ 1.2 Release * ActiveMQ 1.3 Release * ActiveMQ 1.1 Release -- View this message in context: http://www.nabble.com/CONFUSED%21-%21--What-is-the-released-version-now--tp16918172s2354p16918172.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/
Re: Release dates
4.1.2 is currently being released, so it should be out very soon (end of this week or next week). Not sure for 5.1, though. On Tue, Apr 8, 2008 at 3:50 PM, Dhruba Bandopadhyay [EMAIL PROTECTED] wrote: Hi, Are there any provisional rough release dates or time frames for 4.1.2 and 5.1? Thanks. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/
Re: Problems building with Maven
This error comes from garbage in your local repo. Just delete it and retry. rm -Rf ~/.m2/repository On 9/17/07, pjackson [EMAIL PROTECTED] wrote: I tried compiling the ActiveMQ 4.1.1 source with Maven 2.0.4 and 2.0.7 and get this error. Can't figure out how to fix maven to get past this. Any help appreciated. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\_tools\ActiveMq\apache-activemq-4.1.1mvn clean install [INFO] Scanning for projects... [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [clean, install] [INFO] [INFO] [ERROR] BUILD ERROR [INFO] [INFO] The plugin 'org.apache.maven.plugins:maven-clean-plugin' does not exist or no valid version could be found [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 1 second [INFO] Finished at: Mon Sep 17 07:45:43 CDT 2007 [INFO] Final Memory: 1M/3M [INFO] C:\_tools\ActiveMq\apache-activemq-4.1.1mvn --version Maven version: 2.0.7 Java version: 1.5.0_11 OS name: windows xp version: 5.1 arch: x86 C:\_tools\ActiveMq\apache-activemq-4.1.1 -- View this message in context: http://www.nabble.com/Problems-building-with-Maven-tf4466474s2354.html#a12735153 Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/
Re: [Spam: 5.0] ClassNotFoundException: No ClassLoaders found for: beans
) at org.jboss.mx.loading.RepositoryClassLoader.loadClass( RepositoryClassLoader.java:405) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.loadClass( XBeanQNameHelper.java:107) at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo( XBeanQNameHelper.java:72) ... 117 more Any ideas how to resolve this? Thanks, Daryl -- View this message in context: http://www.nabble.com/ClassNotFoundException%3A-No-ClassLoaders-found-for%3A-beans-tf3367196s2354.html#a9368319 Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- James --- http://radio.weblogs.com/0112098/ -- View this message in context: http://www.nabble.com/ClassNotFoundException%3A-No-ClassLoaders-found-for%3A-beans-tf3367196s2354.html#a9374227 Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- Cheers, Guillaume Nodet Architect, LogicBlaze (http://www.logicblaze.com/) Blog: http://gnodet.blogspot.com/