Blueprint with AMQ broker plugin...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Blueprint with AMQ broker plugin...

Brad Johnson
I'm not sure if this is the right place for this as it is an issue that sort of straddles concerns.  I've developed a broker plugin for AMQ that monitors logging and fires off events to a queue.  I've created one for GC monitoring that works fine but it doesn't need access to the broker directly.

The problem is two-fold for me.  The first is that the standard AMQ set up is through Spring and not through Blueprint.  Is there an example of using Blueprint instead of Spring to fire up AMQ?

The other issue is when I boot up via the standard Spring Activemq.xml file I naturally run into and issue where the broker throws a class not found exception because my broker plugin bundle hasn't loaded yet.

<bean id="localLoggerAgent" class="com.thales.activemq.agents.ActiveMQLogAgent"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="${broker-name}" dataDirectory="${data}" start="false" restartAllowed="false" plugins="#localLoggerAgent">

ActiveMQLogAgent] for bean with name 'localLoggerAgent' defined in URL [file:etc/activemq.xml]; nested exception is java.lang.ClassNotFoundException: 

I've tried various Karaf loader mechanisms including adding dependencies into the system folder, modifying the features/boot, etc.

I suspect there's a much easier way of doing this that I'm just not getting primarily due to the Spring/Blueprint differential.  If it were all in Blueprint I'd have a pretty good idea of how to get it and my plugin and the Camel routes humming along together.

Any pointers for this would be helpful.

Reply | Threaded
Open this post in threaded view
|

Re: Blueprint with AMQ broker plugin...

lichtin
Hi Brad

I'm using an alternative to configure a custom plugin that works fine for me in Karaf.
Just add a <bean> inside <plugins>:

         <plugins>
             <bean xmlns="http://www.springframework.org/schema/beans" id="outOfSpacePlugin" class="xxx.MyPlugin">
                 <property name="myPluginProperty1">
                     <value>5</value>
                 </property>
             </bean>
         </plugins>

I have MyPlugin class in the same bundle that has the activemq.xml and the org.apache.activemq.server-default.cfg files.

- Martin


On 04.11.2016 15:08, Brad Johnson wrote:

> I'm not sure if this is the right place for this as it is an issue that sort of straddles concerns.  I've developed a broker plugin for AMQ that monitors logging and fires off events to a queue.  I've created one for GC monitoring that works fine but it doesn't need access to the broker directly.
>
> The problem is two-fold for me.  The first is that the standard AMQ set up is through Spring and not through Blueprint.  Is there an example of using Blueprint instead of Spring to fire up AMQ?
>
> The other issue is when I boot up via the standard Spring Activemq.xml file I naturally run into and issue where the broker throws a class not found exception because my broker plugin bundle hasn't loaded yet.
>
> <bean id="localLoggerAgent" class="com.thales.activemq.agents.ActiveMQLogAgent"/>
> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="${broker-name}" dataDirectory="${data}" start="false" restartAllowed="false" plugins="#localLoggerAgent">
>
> ActiveMQLogAgent] for bean with name 'localLoggerAgent' defined in URL [file:etc/activemq.xml]; nested exception is java.lang.ClassNotFoundException:
>
> I've tried various Karaf loader mechanisms including adding dependencies into the system folder, modifying the features/boot, etc.
>
> I suspect there's a much easier way of doing this that I'm just not getting primarily due to the Spring/Blueprint differential.  If it were all in Blueprint I'd have a pretty good idea of how to get it and my plugin and the Camel routes humming along together.
>
> Any pointers for this would be helpful.
>