This closes #460
This commit is contained in:
commit
edc514196b
11
README.md
11
README.md
|
@ -29,16 +29,13 @@ To run an example firstly make sure you have run
|
|||
|
||||
If the project version has already been released then this is unnecessary.
|
||||
|
||||
then you will need to set the following maven options, on Linux by
|
||||
|
||||
$ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
|
||||
|
||||
and the finally run the examples by
|
||||
Each individual example can be run using this command from its corresponding directory:
|
||||
|
||||
$ mvn verify
|
||||
|
||||
You can also run individual examples by running the same command from the directory of which ever example you want to run.
|
||||
NB for this make sure you have installed examples/common.
|
||||
If you wish to run groups of examples then use this command from a parent directory (e.g. examples/features/standard):
|
||||
|
||||
$ mvn -Pexamples verify
|
||||
|
||||
### Recreating the examples
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
Running the ActiveMQ Artemis Examples
|
||||
============================
|
||||
|
||||
To run an individual example firstly cd into the example directory and run
|
||||
|
||||
```sh
|
||||
mvn verify
|
||||
```
|
||||
|
||||
Most examples offer a way to start them without creating and starting the server (say if you want to do it manually)
|
||||
|
||||
```sh
|
||||
mvn verify -PnoServer
|
||||
```
|
||||
|
||||
If you are running against an un released version, i.e. from master branch, you will have to run `mvn install` on the root
|
||||
pom.xml and the example/activemq-jms-examples-common/pom.xml first.
|
||||
|
||||
If you want to run all the examples (except those that need to be run standalone) you can run `mvn verify -Pexamples` in the examples
|
||||
directory but before you do you will need to up the memory used by running:
|
||||
|
||||
```
|
||||
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
|
||||
```
|
||||
|
||||
if you are running a Mac OS, you may want to add this to run the clustered examples:
|
||||
|
||||
```
|
||||
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"
|
||||
```
|
||||
|
||||
### Recreating the examples
|
||||
|
||||
If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:
|
||||
|
||||
```
|
||||
# if trying to modify the 'topic' example:
|
||||
cd examples/jms/topic && mvn dependency:list
|
||||
```
|
|
@ -48,7 +48,7 @@ under the License.
|
|||
</bean>
|
||||
|
||||
<bean id="EmbeddedJms" class="org.apache.activemq.artemis.integration.spring.SpringJmsBootstrap" init-method="start"
|
||||
destroy-method="stop">
|
||||
destroy-method="close">
|
||||
<property name="SecurityManager" ref="securityManager"/>
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
|
||||
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
|
||||
import org.apache.activemq.artemis.utils.UUIDGenerator;
|
||||
|
||||
|
@ -140,7 +141,7 @@ public class XAHeuristicExample {
|
|||
MBeanServerConnection mbsc = connector.getMBeanServerConnection();
|
||||
|
||||
// Step 27. List the prepared transactions
|
||||
ObjectName serverObject = ObjectNameBuilder.DEFAULT.getActiveMQServerObjectName();
|
||||
ObjectName serverObject = ObjectNameBuilder.create(ActiveMQDefaultConfiguration.getDefaultJmxDomain(), "0.0.0.0", true).getActiveMQServerObjectName();
|
||||
String[] infos = (String[]) mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
|
||||
|
||||
System.out.println("Prepared transactions: ");
|
||||
|
|
|
@ -28,4 +28,8 @@ public class SpringJmsBootstrap extends EmbeddedJMS implements BeanFactoryAware
|
|||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
registry = new SpringBindingRegistry((ConfigurableBeanFactory) beanFactory);
|
||||
}
|
||||
|
||||
public void close() throws Exception {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue