On Apr 7, 2010, at 11:08 AM, easyl wrote:

> 
> ActiveMQ 4 embedded in Geronimo2.1.
> 
> There are many configuration possibilities in AMQ, but many of them should
> be set in a XML file.
> for example,
> http://activemq.apache.org/persistence.html
> 
> How can I configure embedded AMQ? or is there any limitation in Geronimo to
> configure AMQ?
> 
> I know only one method, i.e. ServerUrl in deployment plan
> 
> <conn:resourceadapter>
>>  <conn:resourceadapter-instance>
>>  <conn:config-property-setting
>> name="ServerUrl">tcp://localhost:61616?jms.copyMessageOnSend=false&amp;jms.watchTopicAdvisories=false&amp;socket.tcpNoDelay=true&amp;wireFormat.tcpNoDelayEnabled=true</conn:config-property-setting>
>>  ...
>>                                      
> 
> 
> or here? how?
> GERONIMO/var/config/config.xml
> 
> I cannot find any file to configure under
> GERONIMO/var/activemq

Geronimo 2.2 contains ActiveMQ 5.3 and you can directly configure an activemq 
xml file (in var/activemq/conf, IIRC). You would probably have an easier time 
with G 2.2.

In G 2.1, configuration of the ActiveMQ Broker is via the ActiveMQ GBean. The 
plan.xml file used to establish the configuration defaults is here -- 
http://svn.apache.org/repos/asf/geronimo/server/tags/2.1.4/plugins/activemq/activemq-broker/src/main/plan/plan.xml

The GBean implementation is here -- 
http://svn.apache.org/repos/asf/geronimo/server/tags/2.1.4/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java

GBEAN_INFO would define all of the configurable attributes.  Note that 
brokerUri allows you to configure the location of an activemq xml file. Without 
changing code, however, looks like Geronimo will always configure the 
PersistenceFactory DataDirectory and DataSource (see the doStart() method).

To configure the brokerUri attribute, edit your config.xml file, locate the 
activemq-broker module and add an override of the ActiveMQ GBean. Something 
like:

    <module name="org.apache.geronimo.configs/activemq-broker/2.1.4/car">
        <gbean name="ActiveMQ">
            <attribute name="brokerUri">your-activemq-xml-file-path</attribute>
        </gbean>
        ...
    </module>

You can override any of the attribute values using the above technique.

I've never configured the broker using an external xml file...

--kevan

> 
> does this article still valid for GERONIMO 2.1?
> http://www.ibm.com/developerworks/java/library/os-ag-jmsbeans/

Some of the basic concepts would apply. However, some of the specific xml plans 
are probably dated... There's also some JMS doc in our Wiki... And samples that 
use JMS.

--kevan

Reply via email to