ActiveMQ6-65 Removes XA with JTA example
This example requires a Transaction Manager implementation to run. As we are not shipping with an appropriate Transaction Manager this is being removed.
This commit is contained in:
parent
82f1e7a503
commit
86cdc589d8
|
@ -128,7 +128,6 @@ under the License.
|
|||
<module>xa-heuristic</module>
|
||||
<module>xa-receive</module>
|
||||
<module>xa-send</module>
|
||||
<module>xa-with-jta</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
|
|
|
@ -1,137 +0,0 @@
|
|||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.activemq.examples.jms</groupId>
|
||||
<artifactId>jms-examples</artifactId>
|
||||
<version>6.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>activemq-jms-xa-with-jta-example</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>ActiveMQ6 JMS XA with JTA Example</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq.examples.jms</groupId>
|
||||
<artifactId>activemq-jms-examples-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jms_2.0_spec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-ejb_3.0_spec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>start</id>
|
||||
<goals>
|
||||
<goal>start</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<property>
|
||||
<name>build.directory</name>
|
||||
<value>${basedir}/target/</value>
|
||||
</property>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>runClient</id>
|
||||
<goals>
|
||||
<goal>runClient</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<clientClass>org.apache.activemq.jms.example.XAwithJTAExample</clientClass>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>stop</id>
|
||||
<goals>
|
||||
<goal>stop</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq.examples.jms</groupId>
|
||||
<artifactId>activemq-jms-xa-with-jta-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-core-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-jms-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-jms-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>${netty.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jms_2.0_spec</artifactId>
|
||||
<version>${geronimo.jms.2.spec.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<waitOnStart>false</waitOnStart>
|
||||
<configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -1,220 +0,0 @@
|
|||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ActiveMQ JMS XA with JTA Example</title>
|
||||
<link rel="stylesheet" type="text/css" href="../common/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../common/prettify.css" />
|
||||
<script type="text/javascript" src="../common/prettify.js"></script>
|
||||
</head>
|
||||
<body onload="prettyPrint()">
|
||||
<h1>JMS XA with JTA Example</h1>
|
||||
|
||||
<p>This example shows you how to use JTA interfaces to control transactions with ActiveMQ. JTA provides
|
||||
facilities to start and stop a transaction and enlist XA resources into a transaction.</p>
|
||||
|
||||
<p>ActiveMQ is JTA aware, meaning you can use ActiveMQ in a XA transactional environment
|
||||
and participate in XA transactions. It provides the javax.transaction.xa.XAResource interface for that
|
||||
purpose. Users can get a XAConnectionFactory to create XAConnections and XASessions.</p>
|
||||
|
||||
<p>In this example we get a transaction manager from JBoss JTA to control the transactions. First we create an XASession
|
||||
for receiving and a normal session for sending. Then we start a new xa transaction and enlist the receiving
|
||||
XASession through its XAResource. We then send two words, 'hello' and 'world', receive them, and let the
|
||||
transaction roll back. The received messages are cancelled back to the queue. Next we start
|
||||
a new transaction with the same XAResource enlisted, but this time we commit the transaction after receiving the
|
||||
messages. Then we check that no more messages are to be received. In each transaction a dummy XAResource is also
|
||||
enlisted to show the transaction processing information.</p>
|
||||
|
||||
<h2>Example step-by-step</h2>
|
||||
<p><i>To run the example, simply type <code>mvn verify</code> from this directory. It will download the JBoss JTA jars before
|
||||
it launches the example.</i></p>
|
||||
|
||||
<ol>
|
||||
<li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
|
||||
<pre class="prettyprint">
|
||||
<code>InitialContext initialContext = getContext(0);</code>
|
||||
</pre>
|
||||
|
||||
<li>We look-up the JMS queue object from JNDI</li>
|
||||
<pre class="prettyprint">
|
||||
<code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
|
||||
</pre>
|
||||
|
||||
<li>We perform a lookup on the XA Connection Factory</li>
|
||||
<pre class="prettyprint">
|
||||
<code>XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("/XAConnectionFactory");</code>
|
||||
</pre>
|
||||
|
||||
<li>We create a JMS XAConnection</li>
|
||||
<pre class="prettyprint">
|
||||
<code>connection = cf.createXAConnection();</code>
|
||||
</pre>
|
||||
|
||||
<li>We Start the connection</li>
|
||||
<pre class="prettyprint">
|
||||
<code>connection.start();</code>
|
||||
</pre>
|
||||
|
||||
<li>We create a JMS XASession</li>
|
||||
<pre class="prettyprint">
|
||||
<code>XASession xaSession = connection.createXASession();</code>
|
||||
</pre>
|
||||
|
||||
<li>We create a normal session</li>
|
||||
<pre class="prettyprint">
|
||||
<code>Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
|
||||
</pre>
|
||||
|
||||
<li>We create a normal Message Producer</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
MessageProducer normalProducer = normalSession.createProducer(queue);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We get the JMS Session</li>
|
||||
<pre class="prettyprint">
|
||||
<code>Session session = xaSession.getSession();</code>
|
||||
</pre>
|
||||
|
||||
<li>We create a message consumer</li>
|
||||
<pre class="prettyprint">
|
||||
<code>MessageConsumer xaConsumer = session.createConsumer(queue); </code>
|
||||
</pre>
|
||||
|
||||
<li>We create two Text Messages</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
TextMessage helloMessage = session.createTextMessage("hello");
|
||||
TextMessage worldMessage = session.createTextMessage("world");
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We get the Transaction Manager</li>
|
||||
<pre class="prettyprint">
|
||||
<code>javax.transaction.TransactionManager txMgr = TransactionManager.transactionManager();</code>
|
||||
</pre>
|
||||
|
||||
<li>We start a transaction</li>
|
||||
<pre class="prettyprint">
|
||||
<code>txMgr.begin();</code>
|
||||
</pre>
|
||||
|
||||
<li>We get the JMS XAResource</li>
|
||||
<pre class="prettyprint">
|
||||
<code>XAResource xaRes = xaSession.getXAResource();</code>
|
||||
</pre>
|
||||
|
||||
<li>We enlist the resources in the Transaction work</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
Transaction transaction = txMgr.getTransaction();
|
||||
transaction.enlistResource(new DummyXAResource());
|
||||
transaction.enlistResource(xaRes);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We send two messages.</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
normalProducer.send(helloMessage);
|
||||
normalProducer.send(worldMessage);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We receive the messages</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
TextMessage rm1 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received: " + rm1.getText());
|
||||
TextMessage rm2 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received: " + rm2.getText());
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We roll back the transaction</li>
|
||||
<pre class="prettyprint">
|
||||
<code>txMgr.rollback();</code>
|
||||
</pre>
|
||||
|
||||
<li>We create another transaction </li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
txMgr.begin();
|
||||
transaction = txMgr.getTransaction();
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We enlist the resources to start the transaction work</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
transaction.enlistResource(new DummyXAResource());
|
||||
transaction.enlistResource(xaRes);
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We receive those messages again</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
rm1 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received again: " + rm1.getText());
|
||||
rm2 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received again: " + rm2.getText());
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>We commit</li>
|
||||
<pre class="prettyprint">
|
||||
<code>txMgr.commit();</code>
|
||||
</pre>
|
||||
|
||||
<li>We check that no more messages are received.</li>
|
||||
<pre class="prettyprint">
|
||||
<code>
|
||||
TextMessage rm3 = (TextMessage)xaConsumer.receive(2000);
|
||||
if (rm3 == null)
|
||||
{
|
||||
System.out.println("No message received after commit.");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
|
||||
|
||||
<pre class="prettyprint">
|
||||
<code>finally
|
||||
{
|
||||
if (initialContext != null)
|
||||
{
|
||||
initialContext.close();
|
||||
}
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}</code>
|
||||
</pre>
|
||||
</ol>
|
||||
</body>
|
||||
</html>
|
|
@ -1,220 +0,0 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.jms.example;
|
||||
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
import javax.jms.XAConnection;
|
||||
import javax.jms.XAConnectionFactory;
|
||||
import javax.jms.XASession;
|
||||
import javax.naming.InitialContext;
|
||||
import javax.transaction.Transaction;
|
||||
import javax.transaction.xa.XAException;
|
||||
import javax.transaction.xa.XAResource;
|
||||
import javax.transaction.xa.Xid;
|
||||
|
||||
import org.apache.activemq.common.example.ActiveMQExample;
|
||||
|
||||
/**
|
||||
* A simple JMS example showing the ActiveMQ XA support with JTA.
|
||||
*
|
||||
* @author <a href="hgao@redhat.com">Howard Gao</a>
|
||||
*/
|
||||
public class XAwithJTAExample extends ActiveMQExample
|
||||
{
|
||||
private volatile boolean result = true;
|
||||
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
new XAwithJTAExample().run(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean runExample() throws Exception
|
||||
{
|
||||
XAConnection connection = null;
|
||||
InitialContext initialContext = null;
|
||||
try
|
||||
{
|
||||
// Step 1. Create an initial context to perform the JNDI lookup.
|
||||
initialContext = new InitialContext();
|
||||
|
||||
// Step 2. Lookup on the queue
|
||||
Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
|
||||
|
||||
// Step 3. Perform a lookup on the XA Connection Factory
|
||||
XAConnectionFactory cf = (XAConnectionFactory)initialContext.lookup("XAConnectionFactory");
|
||||
|
||||
// Step 4.Create a JMS XAConnection
|
||||
connection = cf.createXAConnection();
|
||||
|
||||
// Step 5. Start the connection
|
||||
connection.start();
|
||||
|
||||
// Step 6. Create a JMS XASession
|
||||
XASession xaSession = connection.createXASession();
|
||||
|
||||
// Step 7. Create a normal session
|
||||
Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
|
||||
// Step 8. Create a normal Message Producer
|
||||
MessageProducer normalProducer = normalSession.createProducer(queue);
|
||||
|
||||
// Step 9. Get the JMS Session
|
||||
Session session = xaSession.getSession();
|
||||
|
||||
// Step 10. Create a message consumer
|
||||
MessageConsumer xaConsumer = session.createConsumer(queue);
|
||||
|
||||
// Step 11. Create two Text Messages
|
||||
TextMessage helloMessage = session.createTextMessage("hello");
|
||||
TextMessage worldMessage = session.createTextMessage("world");
|
||||
|
||||
// Step 12. Get the Transaction Manager
|
||||
javax.transaction.TransactionManager txMgr = TransactionManager.transactionManager();
|
||||
|
||||
// Step 13. Start a transaction
|
||||
txMgr.begin();
|
||||
|
||||
// Step 14. Get the JMS XAResource
|
||||
XAResource xaRes = xaSession.getXAResource();
|
||||
|
||||
// Step 15. enlist the resource in the Transaction work
|
||||
Transaction transaction = txMgr.getTransaction();
|
||||
transaction.enlistResource(new DummyXAResource());
|
||||
transaction.enlistResource(xaRes);
|
||||
|
||||
// Step 16. Send two messages.
|
||||
normalProducer.send(helloMessage);
|
||||
normalProducer.send(worldMessage);
|
||||
|
||||
// Step 17. Receive the message
|
||||
TextMessage rm1 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received: " + rm1.getText());
|
||||
TextMessage rm2 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received: " + rm2.getText());
|
||||
|
||||
// Step 18. Roll back the transaction
|
||||
txMgr.rollback();
|
||||
|
||||
// Step 19. Create another transaction
|
||||
txMgr.begin();
|
||||
transaction = txMgr.getTransaction();
|
||||
|
||||
// Step 20. Enlist the resources to start the transaction work
|
||||
transaction.enlistResource(new DummyXAResource());
|
||||
transaction.enlistResource(xaRes);
|
||||
|
||||
// Step 21. receive those messages again
|
||||
rm1 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received again: " + rm1.getText());
|
||||
rm2 = (TextMessage)xaConsumer.receive();
|
||||
System.out.println("Message received again: " + rm2.getText());
|
||||
|
||||
// Step 22. Commit!
|
||||
txMgr.commit();
|
||||
|
||||
// Step 23. Check no more messages are received.
|
||||
TextMessage rm3 = (TextMessage)xaConsumer.receive(2000);
|
||||
if (rm3 == null)
|
||||
{
|
||||
System.out.println("No message received after commit.");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Step 24. Be sure to close our JMS resources!
|
||||
if (initialContext != null)
|
||||
{
|
||||
initialContext.close();
|
||||
}
|
||||
if (connection != null)
|
||||
{
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class DummyXAResource implements XAResource
|
||||
{
|
||||
|
||||
public DummyXAResource()
|
||||
{
|
||||
}
|
||||
|
||||
public void commit(final Xid xid, final boolean arg1) throws XAException
|
||||
{
|
||||
System.out.println("DummyXAResource commit() called, xid: " + xid);
|
||||
}
|
||||
|
||||
public void end(final Xid xid, final int arg1) throws XAException
|
||||
{
|
||||
System.out.println("DummyXAResource end() called, xid: " + xid);
|
||||
}
|
||||
|
||||
public void forget(final Xid xid) throws XAException
|
||||
{
|
||||
System.out.println("DummyXAResource forget() called, xid: " + xid);
|
||||
}
|
||||
|
||||
public int getTransactionTimeout() throws XAException
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isSameRM(final XAResource arg0) throws XAException
|
||||
{
|
||||
return this == arg0;
|
||||
}
|
||||
|
||||
public int prepare(final Xid xid) throws XAException
|
||||
{
|
||||
return XAResource.XA_OK;
|
||||
}
|
||||
|
||||
public Xid[] recover(final int arg0) throws XAException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void rollback(final Xid xid) throws XAException
|
||||
{
|
||||
System.out.println("DummyXAResource rollback() called, xid: " + xid);
|
||||
}
|
||||
|
||||
public boolean setTransactionTimeout(final int arg0) throws XAException
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void start(final Xid xid, final int arg1) throws XAException
|
||||
{
|
||||
System.out.println("DummyXAResource start() called, Xid: " + xid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<configuration xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd">
|
||||
|
||||
<bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
|
||||
|
||||
<journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
|
||||
|
||||
<large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
|
||||
|
||||
<paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
|
||||
|
||||
<!-- Acceptors -->
|
||||
<acceptors>
|
||||
<acceptor name="netty-acceptor">
|
||||
<factory-class>org.apache.activemq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
|
||||
</acceptor>
|
||||
</acceptors>
|
||||
|
||||
<!-- Other config -->
|
||||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
<permission type="deleteNonDurableQueue" roles="guest"/>
|
||||
<permission type="consume" roles="guest"/>
|
||||
<permission type="send" roles="guest"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
||||
</configuration>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<configuration xmlns="urn:activemq"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd">
|
||||
|
||||
<!--the queue used by the example-->
|
||||
<queue name="exampleQueue"/>
|
||||
|
||||
</configuration>
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
<configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:activemq /schema/activemq-users.xsd">
|
||||
<!-- the default user. this is used where username is null-->
|
||||
<defaultuser name="guest" password="guest">
|
||||
<role name="guest"/>
|
||||
</defaultuser>
|
||||
</configuration>
|
|
@ -1,175 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<properties>
|
||||
<!--
|
||||
This is the JBossTS configuration file for running ArjunaJTS.
|
||||
It should be called jbossts-properties.xml.
|
||||
You need a different version for ArjunaCore or JTA usage.
|
||||
|
||||
***************************
|
||||
|
||||
Property values may be literals or be tokens of the form ${p1[,p2][:v]}
|
||||
in which case the token values are substituted for the values of the corresponding system
|
||||
properties as follows:
|
||||
|
||||
- Any occurrence of ${p} with the System.getProperty(p) value.
|
||||
If there is no such property p defined, then the ${p} reference will remain unchanged.
|
||||
|
||||
- If the property reference is of the form ${p:v} and there is no such property p,
|
||||
then the default value v will be returned.
|
||||
|
||||
- If the property reference is of the form ${p1,p2} or ${p1,p2:v} then
|
||||
the primary and the secondary properties will be tried in turn, before
|
||||
returning either the unchanged input, or the default value.
|
||||
|
||||
The property ${/} is replaced with System.getProperty("file.separator")
|
||||
value and the property ${:} is replaced with System.getProperty("path.separator").
|
||||
|
||||
Note this substitution applies to property values only at the point they are read from
|
||||
the config file. Tokens in system properties won't be substituted.
|
||||
-->
|
||||
|
||||
<!-- (default is YES) -->
|
||||
<entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
|
||||
|
||||
<!-- default is under user.home - must be writeable!) -->
|
||||
<entry key="ObjectStoreEnvironmentBean.objectStoreDir">PutObjectStoreDirHere</entry>
|
||||
|
||||
<!-- (default is ON) -->
|
||||
<entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
|
||||
|
||||
<!-- (Must be unique across all Arjuna instances.) -->
|
||||
<entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
|
||||
|
||||
<!-- Which Xid types to recover -->
|
||||
<entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
|
||||
|
||||
<entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
|
||||
com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
|
||||
com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
|
||||
</entry>
|
||||
|
||||
<!--
|
||||
Base port number for determining a unique number to associate with an instance of the transaction service
|
||||
(which is needed in order to support multiple instances on the same machine).
|
||||
Use the value 0 to allow the system to select the first available port number.
|
||||
If the port number is non-zero and the port is in use then the value will be incremented until either a successful binding
|
||||
to the loopback address is created or until the the maximum number of ports (specified by the
|
||||
CoreEnvironmentBean.socketProcessIdMaxPorts property) have been tried or until the port number
|
||||
reaches the maximum possible port number.
|
||||
-->
|
||||
<entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Periodic recovery modules to use. Invoked in the order they appear in the list.
|
||||
Check http://www.jboss.org/community/docs/DOC-10788 for more information
|
||||
on recovery modules and their configuration when running in various
|
||||
deployments.
|
||||
-->
|
||||
<entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
|
||||
com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
|
||||
com.arjuna.ats.internal.txoj.recovery.TORecoveryModule
|
||||
com.arjuna.ats.internal.jts.recovery.transactions.TopLevelTransactionRecoveryModule
|
||||
com.arjuna.ats.internal.jts.recovery.transactions.ServerTransactionRecoveryModule
|
||||
com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule
|
||||
</entry>
|
||||
|
||||
<!-- Expiry scanners to use (order of invocation is random). -->
|
||||
<entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
|
||||
com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
|
||||
com.arjuna.ats.internal.jts.recovery.contact.ExpiredContactScanner
|
||||
com.arjuna.ats.internal.jts.recovery.transactions.ExpiredToplevelScanner
|
||||
com.arjuna.ats.internal.jts.recovery.transactions.ExpiredServerScanner
|
||||
</entry>
|
||||
|
||||
<!--
|
||||
Add the following to the set of expiryScannerClassNames above to move logs that cannot be completed by failure recovery.
|
||||
But be sure you know what you are doing and why!
|
||||
com.arjuna.ats.internal.arjuna.recovery.AtomicActionExpiryScanner
|
||||
-->
|
||||
|
||||
<!--
|
||||
The address and port number on which the recovery manager listens
|
||||
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
|
||||
-->
|
||||
<entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
|
||||
|
||||
<entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
|
||||
|
||||
<!--
|
||||
Use this to fix the port on which the TransactionStatusManager listens,
|
||||
The default behaviour is to use any free port.
|
||||
-->
|
||||
<entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
|
||||
|
||||
<!--
|
||||
Use this to fix the address on which the TransactionStatusManager binds,
|
||||
The default behaviour is to use the loopback address (ie localhost).
|
||||
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
|
||||
-->
|
||||
<entry key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
|
||||
|
||||
<!--
|
||||
For cases where the recovery manager is in process with the transaction manager and nothing else uses
|
||||
the ObjectStore, it is possible to disable the socket based recovery listener by setting this to NO.
|
||||
Caution: use of this property can allow multiple recovery processes to run on the same ObjectStore
|
||||
if you are not careful. That in turn can lead to incorrect transaction processing. Use with care.
|
||||
-->
|
||||
<entry key="RecoveryEnvironmentBean.recoveryListener">YES</entry>
|
||||
|
||||
|
||||
<!-- Recovery Activators to use. -->
|
||||
<entry key="RecoveryEnvironmentBean.recoveryActivatorClassNames">com.arjuna.ats.internal.jts.orbspecific.recovery.RecoveryEnablement</entry>
|
||||
|
||||
|
||||
<entry key="JTAEnvironmentBean.transactionManagerClassName">com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple</entry>
|
||||
|
||||
<entry key="JTAEnvironmentBean.userTransactionClassName">com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple</entry>
|
||||
|
||||
<entry key="JTAEnvironmentBean.transactionSynchronizationRegistryClassName">com.arjuna.ats.internal.jta.transaction.jts.TransactionSynchronizationRegistryImple</entry>
|
||||
|
||||
|
||||
<entry key="OrbPortabilityEnvironmentBean.bindMechanism">CONFIGURATION_FILE</entry>
|
||||
|
||||
<entry key="OrbPortabilityEnvironmentBean.orbInitializationProperties">
|
||||
<!-- This class handles context propagation issues, and should never be commented out or removed. -->
|
||||
com.arjuna.orbportability.orb.PreInit1=com.arjuna.ats.internal.jts.context.ContextPropagationManager
|
||||
<!-- This property ensures the JTS knows which ORB to use and should never be commented out or removed -->
|
||||
com.arjuna.orbportability.orb.PostInit=com.arjuna.ats.jts.utils.ORBSetup
|
||||
<!-- This property ensures the crash recovery is initialised correctly and should never be commented out or removed -->
|
||||
com.arjuna.orbportability.orb.PostInit2=com.arjuna.ats.internal.jts.recovery.RecoveryInit
|
||||
<!-- This property ensures the JTS knows which ORB to use and should never be commented out or removed -->
|
||||
com.arjuna.orbportability.orb.PostSet1=com.arjuna.ats.jts.utils.ORBSetup
|
||||
</entry>
|
||||
|
||||
<!--
|
||||
This property controls the port on which the Recovery ORB listens
|
||||
-->
|
||||
<entry key="JTSEnvironmentBean.recoveryManagerPort">4711</entry>
|
||||
|
||||
<!--
|
||||
This property controls the address on which the Recovery ORB binds - defaults to the loopback connection
|
||||
If running within an AS then the address the AS is bound to (jboss.bind.address) takes precedence
|
||||
-->
|
||||
<entry key="JTSEnvironmentBean.recoveryManagerAddress"></entry>
|
||||
|
||||
|
||||
</properties>
|
|
@ -1,20 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
|
||||
java.naming.provider.url=tcp://localhost:5445
|
||||
queue.queue/exampleQueue=exampleQueue
|
Loading…
Reference in New Issue