raWrapper.doStart();
ActiveMQActivationSpec as = new ActiveMQActivationSpec();
as.setDestination("TEST");
as.setDestinationType(Queue.class.getName());
ActivationSpecWrapper asWrapper = new ActivationSpecWrapper(as, raWrapper);
final Latch messageDelivered = new Latch();
MessageEndpointFactory messageEndpointFactory = new MessageEndpointFactory() {
public MessageEndpoint createEndpoint(XAResource resource) throws UnavailableException {
return new StubMessageEndpoint(etm, resource) {
public void onMessage(Message message) {
super.onMessage(message);
messageDelivered.release();
}
;
};
}
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
return true;
}
};
asWrapper.activate(messageEndpointFactory);
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(new ActiveMQQueue("TEST"));
producer.send(session.createTextMessage("Hello"));