merge #173 - Fix CatX dep and OpenWire issue

This commit is contained in:
Andy Taylor 2015-03-12 11:06:33 +00:00
commit 87520f760e
41 changed files with 402 additions and 332 deletions

View File

@ -50,6 +50,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jgroups</groupId>

View File

@ -50,45 +50,40 @@ public interface ActiveMQClientMessageBundle
{
ActiveMQClientMessageBundle BUNDLE = Messages.getBundle(ActiveMQClientMessageBundle.class);
@Message(id = 119000, value = "ClientSession closed while creating session", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119000, value = "ClientSession closed while creating session")
ActiveMQInternalErrorException clientSessionClosed();
@Message(id = 119001, value = "Failed to create session", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119001, value = "Failed to create session")
ActiveMQInternalErrorException failedToCreateSession(@Cause Throwable t);
@Message(id = 119002, value = "Internal Error! ClientSessionFactoryImpl::createSessionInternal "
+ "just reached a condition that was not supposed to happen. "
+ "Please inform this condition to the ActiveMQ team", format = Message.Format.MESSAGE_FORMAT)
ActiveMQInternalErrorException clietSessionInternal();
@Message(id = 119003, value = "Queue can not be both durable and temporary", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119003, value = "Queue can not be both durable and temporary")
ActiveMQInternalErrorException queueMisConfigured();
@Message(id = 119004, value = "Failed to initialise session factory", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119004, value = "Failed to initialise session factory")
ActiveMQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e);
@Message(id = 119005, value = "Exception in Netty transport", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119005, value = "Exception in Netty transport")
ActiveMQInternalErrorException nettyError();
@Message(id = 119006, value = "Channel disconnected", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119006, value = "Channel disconnected")
ActiveMQNotConnectedException channelDisconnected();
@Message(id = 119007, value = "Cannot connect to server(s). Tried with all available servers.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119007, value = "Cannot connect to server(s). Tried with all available servers.")
ActiveMQNotConnectedException cannotConnectToServers();
@Message(id = 119008, value = "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119008, value = "Failed to connect to any static connectors")
ActiveMQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e);
@Message(id = 119009, value = "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119009, value = "Failed to connect to any static connectors")
ActiveMQNotConnectedException cannotConnectToStaticConnectors2();
@Message(id = 119010, value = "Connection is destroyed", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119010, value = "Connection is destroyed")
ActiveMQNotConnectedException connectionDestroyed();
@Message(id = 119011, value = "Did not receive data from server for {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQConnectionTimedOutException connectionTimedOut(Connection transportConnection);
@Message(id = 119012, value = "Timed out waiting to receive initial broadcast from cluster", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119012, value = "Timed out waiting to receive initial broadcast from cluster")
ActiveMQConnectionTimedOutException connectionTimedOutInInitialBroadcast();
@Message(id = 119013, value = "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT)
@ -97,58 +92,56 @@ public interface ActiveMQClientMessageBundle
@Message(id = 119014, value = "Timed out after waiting {0} ms for response when sending packet {1}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQConnectionTimedOutException timedOutSendingPacket(long timeout, Byte type);
@Message(id = 119015, value = "The connection was disconnected because of server shutdown", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119015, value = "The connection was disconnected because of server shutdown")
ActiveMQDisconnectedException disconnected();
@Message(id = 119016, value = "Connection failure detected. Unblocking a blocking call that will never get a resp" +
"onse", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119016, value = "Connection failure detected. Unblocking a blocking call that will never get a response")
ActiveMQUnBlockedException unblockingACall(@Cause Throwable t);
@Message(id = 119017, value = "Consumer is closed", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119017, value = "Consumer is closed")
ActiveMQObjectClosedException consumerClosed();
@Message(id = 119018, value = "Producer is closed", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119018, value = "Producer is closed")
ActiveMQObjectClosedException producerClosed();
@Message(id = 119019, value = "Session is closed", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119019, value = "Session is closed")
ActiveMQObjectClosedException sessionClosed();
@Message(id = 119020, value = "Cannot call receive(...) - a MessageHandler is set", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119020, value = "Cannot call receive(...) - a MessageHandler is set")
ActiveMQIllegalStateException messageHandlerSet();
@Message(id = 119021, value = "Cannot set MessageHandler - consumer is in receive(...)", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119021, value = "Cannot set MessageHandler - consumer is in receive(...)")
ActiveMQIllegalStateException inReceive();
@Message(id = 119022, value = "Header size ({0}) is too big, use the messageBody for large data, or increase minLargeMessageSize",
format = Message.Format.MESSAGE_FORMAT)
ActiveMQIllegalStateException headerSizeTooBig(Integer headerSize);
@Message(id = 119023, value = "The large message lost connection with its session, either because of a rollback or a closed session", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119023, value = "The large message lost connection with its session, either because of a rollback or a closed session")
ActiveMQIllegalStateException largeMessageLostSession();
@Message(id = 119024, value = "Could not select a TransportConfiguration to create SessionFactory", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119024, value = "Could not select a TransportConfiguration to create SessionFactory")
ActiveMQIllegalStateException noTCForSessionFactory();
@Message(id = 119025, value = "Error saving the message body", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119025, value = "Error saving the message body")
ActiveMQLargeMessageException errorSavingBody(@Cause Exception e);
@Message(id = 119026, value = "Error reading the LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119026, value = "Error reading the LargeMessageBody")
ActiveMQLargeMessageException errorReadingBody(@Cause Exception e);
@Message(id = 119027, value = "Error closing stream from LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119027, value = "Error closing stream from LargeMessageBody")
ActiveMQLargeMessageException errorClosingLargeMessage(@Cause Exception e);
@Message(id = 119028, value = "Timeout waiting for LargeMessage Body", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119028, value = "Timeout waiting for LargeMessage Body")
ActiveMQLargeMessageException timeoutOnLargeMessage();
@Message(id = 119029, value = "Error writing body of message", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119029, value = "Error writing body of message")
ActiveMQLargeMessageException errorWritingLargeMessage(@Cause Exception e);
@Message(id = 119030, value = "The transaction was rolled back on failover to a backup server", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119030, value = "The transaction was rolled back on failover to a backup server")
ActiveMQTransactionRolledBackException txRolledBack();
@Message(id = 119031, value = "The transaction was rolled back on failover however commit may have been successful" +
"", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119031, value = "The transaction was rolled back on failover however commit may have been successful")
ActiveMQTransactionOutcomeUnknownException txOutcomeUnknown();
@Message(id = 119032, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
@ -164,70 +157,67 @@ public interface ActiveMQClientMessageBundle
@Message(id = 119035, value = "Invalid window size {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidWindowSize(Integer size);
@Message(id = 119036, value = "No operation mapped to int {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException noOperationMapped(Integer operation);
@Message(id = 119037, value = "Invalid last Received Command ID: {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidCommandID(Integer lastReceivedCommandID);
@Message(id = 119038, value = "Cannot find channel with id {0} to close", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException noChannelToClose(Long id);
@Message(id = 119039, value = "Close Listener cannot be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119039, value = "Close Listener cannot be null")
IllegalArgumentException closeListenerCannotBeNull();
@Message(id = 119040, value = "Fail Listener cannot be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119040, value = "Fail Listener cannot be null")
IllegalArgumentException failListenerCannotBeNull();
@Message(id = 119041, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException connectionExists(Object id);
@Message(id = 119042, value = "Invalid argument null listener", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119042, value = "Invalid argument null listener")
IllegalArgumentException nullListener();
@Message(id = 119043, value = "Invalid argument null handler", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119043, value = "Invalid argument null handler")
IllegalArgumentException nullHandler();
@Message(id = 119044, value = "No available codec to decode password!", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119044, value = "No available codec to decode password!")
IllegalArgumentException noCodec();
@Message(id = 119045, value = "the first node to be compared is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119045, value = "the first node to be compared is null")
IllegalArgumentException firstNodeNull();
@Message(id = 119046, value = "the second node to be compared is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119046, value = "the second node to be compared is null")
IllegalArgumentException secondNodeNull();
@Message(id = 119047, value = "nodes have different node names", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119047, value = "nodes have different node names")
IllegalArgumentException nodeHaveDifferentNames();
@Message(id = 119048, value = "nodes hava a different number of attributes", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119048, value = "nodes hava a different number of attributes")
IllegalArgumentException nodeHaveDifferentAttNumber();
@Message(id = 119049, value = "attribute {0}={1} does not match", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException attsDontMatch(String name, String value);
@Message(id = 119050, value = "one node has children and the other does not" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119050, value = "one node has children and the other does not")
IllegalArgumentException oneNodeHasChildren();
@Message(id = 119051, value = "nodes hava a different number of children" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119051, value = "nodes hava a different number of children")
IllegalArgumentException nodeHasDifferentChildNumber();
@Message(id = 119052, value = "Element {0} requires a valid Boolean value, but ''{1}'' cannot be parsed as a Boolean" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119052, value = "Element {0} requires a valid Boolean value, but ''{1}'' cannot be parsed as a Boolean", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException mustBeBoolean(Node elem, String value);
@Message(id = 119053, value = "Element {0} requires a valid Double value, but ''{1}'' cannot be parsed as a Double" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119053, value = "Element {0} requires a valid Double value, but ''{1}'' cannot be parsed as a Double", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException mustBeDouble(Node elem, String value);
@Message(id = 119054, value = "Element {0} requires a valid Integer value, but ''{1}'' cannot be parsed as a Integer" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119054, value = "Element {0} requires a valid Integer value, but ''{1}'' cannot be parsed as a Integer", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException mustBeInteger(Node elem, String value);
@Message(id = 119055, value = "Element {0} requires a valid Long value, but ''{1}'' cannot be parsed as a Long" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119055, value = "Element {0} requires a valid Long value, but ''{1}'' cannot be parsed as a Long", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException mustBeLong(Node elem, String value);
@Message(id = 119056, value = "Failed to get decoder" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119056, value = "Failed to get decoder")
IllegalArgumentException failedToGetDecoder(@Cause Exception e);
@Message(id = 119057, value = "Error decoding password" , format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119057, value = "Error decoding password")
IllegalArgumentException errordecodingPassword(@Cause Exception e);
@Message(id = 119058, value = "Address \"{0}\" is full. Message encode size = {1}B", format = Message.Format.MESSAGE_FORMAT)
@ -237,11 +227,6 @@ public interface ActiveMQClientMessageBundle
, format = Message.Format.MESSAGE_FORMAT)
ActiveMQInterceptorRejectedPacketException interceptorRejectedPacket(String interceptionResult);
@Message(id = 119060, value = "Large Message Transmission interrupted on consumer shutdown."
, format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119060, value = "Large Message Transmission interrupted on consumer shutdown.")
ActiveMQLargeMessageInterruptedException largeMessageInterrupted();
@Message(id = 119061, value = "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT)
String decodeError();
}

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>

View File

@ -49,48 +49,47 @@ public interface ActiveMQJMSClientBundle
@Message(id = 129000, value = "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQInvalidFilterExpressionException invalidFilter(@Cause Throwable e, SimpleString filter);
@Message(id = 129001, value = "Invalid Subscription Name. It is required to set the subscription name", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129001, value = "Invalid Subscription Name. It is required to set the subscription name")
ActiveMQIllegalStateException invalidSubscriptionName();
@Message(id = 129002, value = "Destination {0} does not exist", format = Message.Format.MESSAGE_FORMAT)
ActiveMQNonExistentQueueException destinationDoesNotExist(SimpleString destination);
@Message(id = 129003, value = "name cannot be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129003, value = "name cannot be null")
IllegalArgumentException nameCannotBeNull();
@Message(id = 129004, value = "name cannot be empty", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129004, value = "name cannot be empty")
IllegalArgumentException nameCannotBeEmpty();
@Message(id = 129005, value = "It is illegal to call this method from within a Message Listener", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129005, value = "It is illegal to call this method from within a Message Listener")
IllegalStateRuntimeException callingMethodFromListenerRuntime();
@Message(id = 129006, value = "It is illegal to call this method from within a Message Listener", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129006, value = "It is illegal to call this method from within a Message Listener")
IllegalStateException callingMethodFromListener();
@Message(id = 129007, value = "It is illegal to call this method from within a Completion Listener", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129007, value = "It is illegal to call this method from within a Completion Listener")
IllegalStateRuntimeException callingMethodFromCompletionListenerRuntime();
@Message(id = 129008, value = "It is illegal to call this method from within a Completion Listener", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129008, value = "It is illegal to call this method from within a Completion Listener")
IllegalStateException callingMethodFromCompletionListener();
@Message(id = 129009, value = "Null {0} is not allowed", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException nullArgumentNotAllowed(String type);
@Message(id = 129010, value = "Topic (Destination) cannot be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129010, value = "Topic (Destination) cannot be null")
InvalidDestinationException nullTopic();
@Message(id = 129011, value = "LargeMessage streaming is only possible on ByteMessage or StreamMessage",
format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129011, value = "LargeMessage streaming is only possible on ByteMessage or StreamMessage")
IllegalStateException onlyValidForByteOrStreamMessages();
@Message(id = 129012, value = "The property name ''{0}'' is not a valid java identifier.",
format = Message.Format.MESSAGE_FORMAT)
JMSRuntimeException invalidJavaIdentifier(String propertyName);
@Message(id = 129013, value = "Message is read-only", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129013, value = "Message is read-only")
MessageNotWriteableException messageNotWritable();
@Message(id = 129014, value = "Message is write-only", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129014, value = "Message is write-only")
MessageNotReadableException messageNotReadable();
@Message(id = 129015, value = "Illegal deliveryMode value: {0}", format = Message.Format.MESSAGE_FORMAT)

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>

View File

@ -40,16 +40,10 @@ public interface ActiveMQJMSServerBundle
@Message(id = 129000, value = "Connection Factory {0} does not exist" , format = Message.Format.MESSAGE_FORMAT)
ActiveMQInternalErrorException cfDoesntExist(String name);
@Message(id = 129001, value = "Invalid signature {0} parsing Connection Factory" , format = Message.Format.MESSAGE_FORMAT)
ActiveMQInternalErrorException invalidSignatureParsingCF(String sig);
@Message(id = 129002, value = "Invalid node {0} parsing Connection Factory", format = Message.Format.MESSAGE_FORMAT)
ActiveMQInternalErrorException invalidNodeParsingCF(String name);
@Message(id = 129003, value = "Discovery Group ''{0}'' does not exist on main config", format = Message.Format.MESSAGE_FORMAT)
ActiveMQIllegalStateException discoveryGroupDoesntExist(String name);
@Message(id = 129004, value = "No Connector name configured on create ConnectionFactory", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129004, value = "No Connector name configured on create ConnectionFactory")
ActiveMQIllegalStateException noConnectorNameOnCF();
@Message(id = 129005, value = "Connector ''{0}'' not found on the main configuration file" , format = Message.Format.MESSAGE_FORMAT)
@ -58,6 +52,6 @@ public interface ActiveMQJMSServerBundle
@Message(id = 129006, value = "Binding {0} is already being used by another connection factory", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAddressExistsException cfBindingsExists(String name);
@Message(id = 129007, value = "Error decoding password using codec instance", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 129007, value = "Error decoding password using codec instance")
ActiveMQIllegalStateException errorDecodingPassword(@Cause Exception e);
}

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -37,13 +37,12 @@ public interface ActiveMQJournalBundle
@Message(id = 149000, value = "failed to rename file {0} to {1}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQIOErrorException ioRenameFileError(String name, String newFileName);
@Message(id = 149001, value = "Journal data belong to a different version", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 149001, value = "Journal data belong to a different version")
ActiveMQIOErrorException journalDifferentVersion();
@Message(id = 149002, value = "Journal files version mismatch. You should export the data from the previous version and import it as explained on the user''s manual",
format = Message.Format.MESSAGE_FORMAT)
@Message(id = 149002, value = "Journal files version mismatch. You should export the data from the previous version and import it as explained on the user''s manual")
ActiveMQIOErrorException journalFileMisMatch();
@Message(id = 149003, value = "File not opened", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 149003, value = "File not opened")
ActiveMQIOErrorException fileNotOpened();
}

View File

@ -43,6 +43,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -32,6 +32,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -31,12 +31,14 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import javax.jms.InvalidDestinationException;
import javax.jms.JMSSecurityException;
import javax.jms.ResourceAllocationException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQNonExistentQueueException;
import org.apache.activemq.api.core.ActiveMQSecurityException;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQMessage;
@ -1242,8 +1244,27 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
@Override
public Response processAddProducer(ProducerInfo info) throws Exception
{
protocolManager.addProducer(this, info);
return null;
Response resp = null;
try
{
protocolManager.addProducer(this, info);
}
catch (Exception e)
{
if (e instanceof ActiveMQSecurityException)
{
resp = new ExceptionResponse(new JMSSecurityException(e.getMessage()));
}
else if (e instanceof ActiveMQNonExistentQueueException)
{
resp = new ExceptionResponse(new InvalidDestinationException(e.getMessage()));
}
else
{
resp = new ExceptionResponse(e);
}
}
return resp;
}
@Override

View File

@ -440,7 +440,7 @@ public class OpenWireProtocolManager implements ProtocolManager
return false;
}
public void addProducer(OpenWireConnection theConn, ProducerInfo info)
public void addProducer(OpenWireConnection theConn, ProducerInfo info) throws Exception
{
SessionId sessionId = info.getProducerId().getParentId();
ConnectionId connectionId = sessionId.getParentId();

View File

@ -20,6 +20,10 @@ package org.apache.activemq.core.protocol.openwire;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.core.protocol.openwire.amq.AMQServerSession;
import org.apache.activemq.core.protocol.openwire.amq.AMQSession;
import org.apache.activemq.core.server.ActiveMQMessageBundle;
import org.apache.activemq.core.server.BindingQueryResult;
import org.apache.activemq.util.ByteSequence;
import org.apache.activemq.api.core.SimpleString;
@ -47,6 +51,22 @@ public class OpenWireUtil
}
}
/**
* Checks to see if this destination exists. If it does not throw an invalid destination exception.
* @param destination
* @param amqSession
*/
public static void validateDestination(ActiveMQDestination destination, AMQSession amqSession) throws Exception
{
AMQServerSession coreSession = amqSession.getCoreSession();
SimpleString physicalName = OpenWireUtil.toCoreAddress(destination);
BindingQueryResult result = coreSession.executeBindingQuery(physicalName);
if (!result.isExists())
{
throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(physicalName);
}
}
/*
*This util converts amq wildcards to compatible core wildcards
*The conversion is like this:

View File

@ -17,6 +17,7 @@
package org.apache.activemq.core.protocol.openwire.amq;
import org.apache.activemq.command.ProducerInfo;
import org.apache.activemq.core.protocol.openwire.OpenWireUtil;
public class AMQProducer
{
@ -29,9 +30,8 @@ public class AMQProducer
this.info = info;
}
public void init()
public void init() throws Exception
{
//activemq doesn't have producer at server.
OpenWireUtil.validateDestination(info.getDestination(), amqSession);
}
}

View File

@ -245,7 +245,7 @@ public class AMQSession implements SessionCallback
AMQConsumer consumer = consumers.remove(nativeId);
}
public void createProducer(ProducerInfo info)
public void createProducer(ProducerInfo info) throws Exception
{
AMQProducer producer = new AMQProducer(this, info);
producer.init();

View File

@ -43,6 +43,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -38,21 +38,18 @@ public interface ActiveMQAMQPProtocolMessageBundle
ActiveMQAMQPProtocolMessageBundle BUNDLE = Messages.getBundle(ActiveMQAMQPProtocolMessageBundle.class);
@Message(id = 219000, value = "target address not set", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219000, value = "target address not set")
ActiveMQAMQPInvalidFieldException targetAddressNotSet();
@Message(id = 219001, value = "error creating temporary queue, {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAMQPInternalErrorException errorCreatingTemporaryQueue(String message);
@Message(id = 219002, value = "target address does not exist", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219002, value = "target address does not exist")
ActiveMQAMQPIllegalStateException addressDoesntExist();
@Message(id = 219003, value = "error finding temporary queue, {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAMQPInternalErrorException errorFindingTemporaryQueue(String message);
@Message(id = 219004, value = "error creating ActiveMQ Session, {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAMQPInternalErrorException errorCreatingActiveMQSession(String message);
@Message(id = 219005, value = "error creating ActiveMQ Consumer, {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAMQPInternalErrorException errorCreatingActiveMQConsumer(String message);
@ -65,13 +62,10 @@ public interface ActiveMQAMQPProtocolMessageBundle
@Message(id = 219008, value = "error cancelling message {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAMQPIllegalStateException errorCancellingMessage(String messageID, String message);
@Message(id = 219009, value = "error closing consumer {0}, {1}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAMQPIllegalStateException errorClosingConsumer(long consumerID, String message);
@Message(id = 219010, value = "source address does not exist", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219010, value = "source address does not exist")
ActiveMQAMQPInvalidFieldException sourceAddressDoesntExist();
@Message(id = 219011, value = "source address not set", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219011, value = "source address not set")
ActiveMQAMQPInvalidFieldException sourceAddressNotSet();
@Message(id = 219012, value = "error rolling back coordinator: {0}", format = Message.Format.MESSAGE_FORMAT)
@ -80,6 +74,4 @@ public interface ActiveMQAMQPProtocolMessageBundle
@Message(id = 219013, value = "error committing coordinator: {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAMQPIllegalStateException errorCommittingCoordinator(String message);
@Message(id = 219015, value = "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT)
String decodeError();
}

View File

@ -32,6 +32,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -46,28 +46,28 @@ public interface ActiveMQStompProtocolMessageBundle
@Message(id = 339002, value = "Stomp versions not supported: {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQStompException versionNotSupported(String acceptVersion);
@Message(id = 339003, value = "Header host is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339003, value = "Header host is null")
ActiveMQStompException nullHostHeader();
@Message(id = 339004, value = "Cannot accept null as host", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339004, value = "Cannot accept null as host")
String hostCannotBeNull();
@Message(id = 339005, value = "Header host does not match server host", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339005, value = "Header host does not match server host")
ActiveMQStompException hostNotMatch();
@Message(id = 339006, value = "host {0} does not match server host name", format = Message.Format.MESSAGE_FORMAT)
String hostNotMatchDetails(String host);
@Message(id = 339007, value = "Connection was destroyed.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339007, value = "Connection was destroyed.")
ActiveMQStompException connectionDestroyed();
@Message(id = 339008, value = "Connection has not been established.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339008, value = "Connection has not been established.")
ActiveMQStompException connectionNotEstablished();
@Message(id = 339009, value = "Exception getting session", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339009, value = "Exception getting session")
ActiveMQStompException errorGetSession(@Cause Exception e);
@Message(id = 339010, value = "Connection is not valid.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339010, value = "Connection is not valid.")
ActiveMQStompException invalidConnection();
@Message(id = 339011, value = "Error sending message {0}", format = Message.Format.MESSAGE_FORMAT)
@ -82,7 +82,7 @@ public interface ActiveMQStompProtocolMessageBundle
@Message(id = 339014, value = "Error aborting {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQStompException errorAbortTx(String txID, @Cause Exception e);
@Message(id = 339015, value = "Client must set destination or id header to a SUBSCRIBE command", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339015, value = "Client must set destination or id header to a SUBSCRIBE command")
ActiveMQStompException noDestination();
@Message(id = 339016, value = "Error creating subscription {0}", format = Message.Format.MESSAGE_FORMAT)
@ -94,10 +94,10 @@ public interface ActiveMQStompProtocolMessageBundle
@Message(id = 339018, value = "Error acknowledging message {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQStompException errorAck(String messageID, @Cause Exception e);
@Message(id = 339019, value = "Invalid char sequence: two consecutive CRs.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339019, value = "Invalid char sequence: two consecutive CRs.")
ActiveMQStompException invalidTwoCRs();
@Message(id = 339020, value = "Invalid char sequence: There is a CR not followed by an LF", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339020, value = "Invalid char sequence: There is a CR not followed by an LF")
ActiveMQStompException badCRs();
@Message(id = 339021, value = "Expect new line char but is {0}", format = Message.Format.MESSAGE_FORMAT)
@ -118,36 +118,36 @@ public interface ActiveMQStompProtocolMessageBundle
@Message(id = 339026, value = "subscription id {0} does not match {1}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQStompException subscriptionIDMismatch(String subscriptionID, String actualID);
@Message(id = 339027, value = "Cannot create a subscriber on the durable subscription if the client-id of the connection is not set", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339027, value = "Cannot create a subscriber on the durable subscription if the client-id of the connection is not set")
IllegalStateException missingClientID();
@Message(id = 339028, value = "Message header too big, increase minLargeMessageSize please.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339028, value = "Message header too big, increase minLargeMessageSize please.")
Exception headerTooBig();
@Message(id = 339029, value = "Unsupported command: {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQStompException unknownCommand(String command);
@Message(id = 339030, value = "transaction header is mandatory to COMMIT a transaction", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339030, value = "transaction header is mandatory to COMMIT a transaction")
ActiveMQStompException needTxIDHeader();
@Message(id = 339031, value = "Error handling send", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339031, value = "Error handling send")
ActiveMQStompException errorHandleSend(@Cause Exception e);
@Message(id = 339032, value = "Need a transaction id to begin", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339032, value = "Need a transaction id to begin")
ActiveMQStompException beginTxNoID();
@Message(id = 339033, value = "transaction header is mandatory to ABORT a transaction", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339033, value = "transaction header is mandatory to ABORT a transaction")
ActiveMQStompException abortTxNoID();
@Message(id = 339034, value = "This method should not be called", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339034, value = "This method should not be called")
IllegalStateException invalidCall();
@Message(id = 339035, value = "Must specify the subscription''s id or the destination you are unsubscribing from", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339035, value = "Must specify the subscription''s id or the destination you are unsubscribing from")
ActiveMQStompException needIDorDestination();
@Message(id = 339037, value = "Must specify the subscription''s id", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339037, value = "Must specify the subscription''s id")
ActiveMQStompException needSubscriptionID();
@Message(id = 339039, value = "No id header in ACK/NACK frame.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 339039, value = "No id header in ACK/NACK frame.")
ActiveMQStompException noIDInAck();
}

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -23,7 +23,6 @@ import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
import org.jboss.logging.Messages;
import javax.jms.JMSException;
import javax.jms.JMSRuntimeException;
import javax.resource.NotSupportedException;
@ -42,30 +41,24 @@ public interface ActiveMQRABundle
ActiveMQRABundle BUNDLE = Messages.getBundle(ActiveMQRABundle.class);
@Message(id = 159000, value = "Error decoding password using codec instance", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 159000, value = "Error decoding password using codec instance")
ActiveMQIllegalStateException errorDecodingPassword(@Cause Exception e);
@Message(id = 159001, value = "MDB cannot be deployed as it has no Activation Spec. Please provide an Activation!", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 159001, value = "MDB cannot be deployed as it has no Activation Spec. Please provide an Activation!")
NotSupportedException noActivationSpec();
@Message(id = 159002, value = "Please provide a destination for the MDB", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 159002, value = "Please provide a destination for the MDB")
IllegalArgumentException noDestinationName();
@Message(id = 159003, value = ISE, format = Message.Format.MESSAGE_FORMAT)
@Message(id = 159003, value = ISE)
JMSRuntimeException illegalJEEMethod();
@Message(id = 159004, value = "Invalid Session Mode SESSION_TRANSACTED", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 159004, value = "Invalid Session Mode SESSION_TRANSACTED")
JMSRuntimeException invalidSessionTransactedModeRuntime();
@Message(id = 159005, value = "Invalid Session Mode CLIENT_ACKNOWLEDGE", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 159005, value = "Invalid Session Mode CLIENT_ACKNOWLEDGE")
JMSRuntimeException invalidClientAcknowledgeModeRuntime();
@Message(id = 159006, value = "Invalid Session Mode {0}", format = Message.Format.MESSAGE_FORMAT)
JMSRuntimeException invalidAcknowledgeMode(int sessionMode);
@Message(id = 159007, value = "Invalid Session Mode SESSION_TRANSACTED", format = Message.Format.MESSAGE_FORMAT)
JMSException invalidSessionTransactedMode();
@Message(id = 159008, value = "Invalid Session Mode CLIENT_ACKNOWLEDGE", format = Message.Format.MESSAGE_FORMAT)
JMSException invalidClientAcknowledgeMode();
}

View File

@ -38,6 +38,9 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -22,7 +22,6 @@ import org.apache.activemq.api.core.ActiveMQConnectionTimedOutException;
import org.apache.activemq.api.core.ActiveMQDisconnectedException;
import org.apache.activemq.api.core.ActiveMQDuplicateMetaDataException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQIOErrorException;
import org.apache.activemq.api.core.ActiveMQIllegalStateException;
import org.apache.activemq.api.core.ActiveMQIncompatibleClientServerException;
import org.apache.activemq.api.core.ActiveMQInternalErrorException;
@ -67,7 +66,7 @@ public interface ActiveMQMessageBundle
@Message(id = 119002, value = "Thread {0} name = {1} id = {2} group = {3}", format = Message.Format.MESSAGE_FORMAT)
String threadDump(Thread key, String name, Long id, ThreadGroup threadGroup);
@Message(id = 119003, value = "End Thread dump", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119003, value = "End Thread dump")
String endThreadDump();
@Message(id = 119004, value = "Information about server {0}\nCluster Connection:{1}", format = Message.Format.MESSAGE_FORMAT)
@ -76,22 +75,22 @@ public interface ActiveMQMessageBundle
@Message(id = 119005, value = "connections for {0} closed by management", format = Message.Format.MESSAGE_FORMAT)
ActiveMQInternalErrorException connectionsClosedByManagement(String ipAddress);
@Message(id = 119006, value = "journals are not JournalImpl. You can''t set a replicator!", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119006, value = "journals are not JournalImpl. You can''t set a replicator!")
ActiveMQInternalErrorException notJournalImpl();
@Message(id = 119007, value = "unhandled error during replication", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119007, value = "unhandled error during replication")
ActiveMQInternalErrorException replicationUnhandledError(@Cause Exception e);
@Message(id = 119008, value = "Live Node contains more journals than the backup node. Probably a version match error", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119008, value = "Live Node contains more journals than the backup node. Probably a version match error")
ActiveMQInternalErrorException replicationTooManyJournals();
@Message(id = 119009, value = "Unhandled file type {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQInternalErrorException replicationUnhandledFileType(ReplicationSyncFileMessage.FileType fileType);
@Message(id = 119010, value = "Remote Backup can not be up-to-date!", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119010, value = "Remote Backup can not be up-to-date!")
ActiveMQInternalErrorException replicationBackupUpToDate();
@Message(id = 119011, value = "unhandled data type!", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119011, value = "unhandled data type!")
ActiveMQInternalErrorException replicationUnhandledDataType();
@Message(id = 119012, value = "No binding for divert {0}", format = Message.Format.MESSAGE_FORMAT)
@ -109,12 +108,6 @@ public interface ActiveMQMessageBundle
" The connection will now be closed.", format = Message.Format.MESSAGE_FORMAT)
ActiveMQConnectionTimedOutException clientExited(String remoteAddress);
@Message(id = 119015, value = "Timeout on waiting I/O completion", format = Message.Format.MESSAGE_FORMAT)
ActiveMQIOErrorException ioTimeout();
@Message(id = 119016, value = "queue {0} has been removed cannot deliver message, queues should not be removed when grouping is used", format = Message.Format.MESSAGE_FORMAT)
ActiveMQNonExistentQueueException groupingQueueRemoved(SimpleString chosenClusterName);
@Message(id = 119017, value = "Queue {0} does not exist", format = Message.Format.MESSAGE_FORMAT)
ActiveMQNonExistentQueueException noSuchQueue(SimpleString queueName);
@ -127,22 +120,22 @@ public interface ActiveMQMessageBundle
@Message(id = 119020, value = "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQInvalidFilterExpressionException invalidFilter(@Cause Throwable e, SimpleString filter);
@Message(id = 119021, value = "MessageId was not assigned to Message", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119021, value = "MessageId was not assigned to Message")
ActiveMQIllegalStateException messageIdNotAssigned();
@Message(id = 119022, value = "Cannot compare journals if not in sync!", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119022, value = "Cannot compare journals if not in sync!")
ActiveMQIllegalStateException journalsNotInSync();
@Message(id = 119023, value = "Connected server is not a backup server", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119023, value = "Connected server is not a backup server")
ActiveMQIllegalStateException serverNotBackupServer();
@Message(id = 119024, value = "Backup replication server is already connected to another server", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119024, value = "Backup replication server is already connected to another server")
ActiveMQIllegalStateException alreadyHaveReplicationServer();
@Message(id = 119025, value = "Cannot delete queue {0} on binding {1} - it has consumers = {2}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQIllegalStateException cannotDeleteQueue(SimpleString name, SimpleString queueName, String s);
@Message(id = 119026, value = "Backup Server was not yet in sync with live", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119026, value = "Backup Server was not yet in sync with live")
ActiveMQIllegalStateException backupServerNotInSync();
@Message(id = 119027, value = "Could not find reference on consumer ID={0}, messageId = {1} queue = {2}", format = Message.Format.MESSAGE_FORMAT)
@ -151,10 +144,10 @@ public interface ActiveMQMessageBundle
@Message(id = 119028, value = "Consumer {0} doesn''t exist on the server", format = Message.Format.MESSAGE_FORMAT)
ActiveMQIllegalStateException consumerDoesntExist(long consumerID);
@Message(id = 119029, value = "No address configured on the Server''s Session", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119029, value = "No address configured on the Server''s Session")
ActiveMQIllegalStateException noAddress();
@Message(id = 119030, value = "large-message not initialized on server", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119030, value = "large-message not initialized on server")
ActiveMQIllegalStateException largeMessageNotInitialised();
@Message(id = 119031, value = "Unable to validate user: {0}", format = Message.Format.MESSAGE_FORMAT)
@ -163,10 +156,10 @@ public interface ActiveMQMessageBundle
@Message(id = 119032, value = "User: {0} does not have permission=''{1}'' on address {2}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQSecurityException userNoPermissions(String username, CheckType checkType, String saddress);
@Message(id = 119033, value = "Server and client versions incompatible", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119033, value = "Server and client versions incompatible")
ActiveMQIncompatibleClientServerException incompatibleClientServer();
@Message(id = 119034, value = "Server not started", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119034, value = "Server not started")
ActiveMQSessionCreationException serverNotStarted();
@Message(id = 119035, value = "Metadata {0}={1} had been set already", format = Message.Format.MESSAGE_FORMAT)
@ -175,9 +168,6 @@ public interface ActiveMQMessageBundle
@Message(id = 119036, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidType(Object type);
@Message(id = 119037, value = "retry interval must be positive, was {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidRetryInterval(Long size);
@Message(id = 119038, value = "{0} must neither be null nor empty", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException emptyOrNull(String name);
@ -214,7 +204,7 @@ public interface ActiveMQMessageBundle
@Message(id = 119049, value = "No queue found for {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException noQueueFound(String otherQueueName);
@Message(id = 119050, value = "Only NIO and AsyncIO are supported journals", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119050, value = "Only NIO and AsyncIO are supported journals")
IllegalArgumentException invalidJournal();
@Message(id = 119051, value = "Invalid journal type {0}", format = Message.Format.MESSAGE_FORMAT)
@ -223,28 +213,25 @@ public interface ActiveMQMessageBundle
@Message(id = 119052, value = "Directory {0} does not exist and cannot be created", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException cannotCreateDir(String dir);
@Message(id = 119053, value = "Invalid index {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidIndex(Integer index);
@Message(id = 119054, value = "Cannot convert to int", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119054, value = "Cannot convert to int")
IllegalArgumentException cannotConvertToInt();
@Message(id = 119055, value = "Routing name is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119055, value = "Routing name is null")
IllegalArgumentException routeNameIsNull();
@Message(id = 119056, value = "Cluster name is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119056, value = "Cluster name is null")
IllegalArgumentException clusterNameIsNull();
@Message(id = 119057, value = "Address is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119057, value = "Address is null")
IllegalArgumentException addressIsNull();
@Message(id = 119058, value = "Binding type not specified", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119058, value = "Binding type not specified")
IllegalArgumentException bindingTypeNotSpecified();
@Message(id = 119059, value = "Binding ID is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119059, value = "Binding ID is null")
IllegalArgumentException bindingIdNotSpecified();
@Message(id = 119060, value = "Distance is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119060, value = "Distance is null")
IllegalArgumentException distancenotSpecified();
@Message(id = 119061, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT)
@ -259,10 +246,10 @@ public interface ActiveMQMessageBundle
@Message(id = 119064, value = "Unknown protocol {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException unknownProtocol(String protocol);
@Message(id = 119065, value = "node id is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119065, value = "node id is null")
IllegalArgumentException nodeIdNull();
@Message(id = 119066, value = "Queue name is null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119066, value = "Queue name is null")
IllegalArgumentException queueNameIsNull();
@Message(id = 119067, value = "Cannot find resource with name {0}", format = Message.Format.MESSAGE_FORMAT)
@ -274,16 +261,16 @@ public interface ActiveMQMessageBundle
@Message(id = 119069, value = "no operation {0}/{1}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException noOperation(String operation, Integer length);
@Message(id = 119070, value = "match can not be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119070, value = "match can not be null")
IllegalArgumentException nullMatch();
@Message(id = 119071, value = "# can only be at end of match", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119071, value = "# can only be at end of match")
IllegalArgumentException invalidMatch();
@Message(id = 119072, value = "User cannot be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119072, value = "User cannot be null")
IllegalArgumentException nullUser();
@Message(id = 119073, value = "Password cannot be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119073, value = "Password cannot be null")
IllegalArgumentException nullPassword();
@Message(id = 119074, value = "Error instantiating transformer class {0}", format = Message.Format.MESSAGE_FORMAT)
@ -316,7 +303,7 @@ public interface ActiveMQMessageBundle
@Message(id = 119079, value = "No session found with {0}={1}", format = Message.Format.MESSAGE_FORMAT)
String destroyConnectionWithSessionMetadataNoSessionFound(String key, String value);
@Message(id = 119080, value = "Invalid Page IO, PagingManager was stopped or closed", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119080, value = "Invalid Page IO, PagingManager was stopped or closed")
ActiveMQIllegalStateException invalidPageIO();
@Message(id = 119081, value = "No Discovery Group configuration named {0} found", format = Message.Format.MESSAGE_FORMAT)
@ -349,15 +336,12 @@ public interface ActiveMQMessageBundle
@Message(id = 119102, value = "Address \"{0}\" is full.", format = Message.Format.MESSAGE_FORMAT)
ActiveMQAddressFullException addressIsFull(String addressName);
@Message(id = 119103, value = "No Connectors or Discovery Groups configured for Scale Down", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119103, value = "No Connectors or Discovery Groups configured for Scale Down")
ActiveMQException noConfigurationFoundForScaleDown();
@Message(id = 119104, value = "Server is stopping. Message grouping not allowed", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 119104, value = "Server is stopping. Message grouping not allowed")
ActiveMQException groupWhileStopping();
@Message(id = 119105, value = "Server will not accept create session request since scale down has not occurred", format = Message.Format.MESSAGE_FORMAT)
ActiveMQSessionCreationException sessionNotFailedOver();
@Message(id = 119106, value = "Invalid slow consumer policy type {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidSlowConsumerPolicyType(String val);

View File

@ -45,6 +45,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>

View File

@ -35,6 +35,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>

View File

@ -36,6 +36,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -33,13 +33,13 @@ public interface ActiveMQAeroGearBundle
{
ActiveMQAeroGearBundle BUNDLE = Messages.getBundle(ActiveMQAeroGearBundle.class);
@Message(id = 239000, value = "endpoint can not be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 239000, value = "endpoint can not be null")
ActiveMQIllegalStateException endpointNull();
@Message(id = 239001, value = "application-id can not be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 239001, value = "application-id can not be null")
ActiveMQIllegalStateException applicationIdNull();
@Message(id = 239002, value = "master-secret can not be null", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 239002, value = "master-secret can not be null")
ActiveMQIllegalStateException masterSecretNull();
@Message(id = 239003, value = "{0}: queue {1} not found", format = Message.Format.MESSAGE_FORMAT)

View File

@ -37,6 +37,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--

View File

@ -76,10 +76,12 @@
</repositories>
<dependencies>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--
JBoss Logging

14
pom.xml
View File

@ -200,10 +200,18 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<version>1.2.1.Final</version>
<scope>compile</scope>
<version>2.0.0.Alpha1</version>
<optional>true</optional>
<!-- License: LGPL-->
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<version>2.0.0.Alpha1</version>
<scope>provided</scope>
<optional>true</optional>
<!-- License: Apache 2.0-->
</dependency>
<!--needed to compile the logging jar-->
<dependency>
<groupId>log4j</groupId>
@ -594,7 +602,7 @@
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javacc-maven-plugin</artifactId>
<artifactId>javacc-maven-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>

View File

@ -155,6 +155,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>

View File

@ -14,16 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.jms.tests.message;
package org.apache.activemq.tests.extras.jms.xa;
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.XAConnection;
import javax.jms.XAConnectionFactory;
import javax.jms.XASession;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
@ -31,27 +34,53 @@ import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
import com.arjuna.ats.arjuna.coordinator.TxControl;
import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
import org.apache.activemq.jms.tests.ActiveMQServerTestCase;
import org.apache.activemq.jms.tests.util.ProxyAssertSupport;
import org.apache.activemq.api.jms.ActiveMQJMSClient;
import org.apache.activemq.tests.util.JMSTestBase;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
*
* A JMSXDeliveryCountTest
*/
public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
public class JMSXDeliveryCountTest extends JMSTestBase
{
// Constants ------------------------------------------------------------------------------------
Queue queue1;
Topic topic1;
// Static ---------------------------------------------------------------------------------------
protected XAConnectionFactory xacf;
// Attributes -----------------------------------------------------------------------------------
@Override
@Before
public void setUp() throws Exception
{
super.setUp();
// Constructors ---------------------------------------------------------------------------------
xacf = ActiveMQJMSClient.createConnectionFactory("tcp://localhost:61616", "test");
// Public ---------------------------------------------------------------------------------------
queue1 = createQueue("queue1");
topic1 = createTopic("topic1");
TxControl.enable();
}
@Override
@After
public void tearDown() throws Exception
{
TxControl.disable(true);
TransactionReaper.terminate(false);
super.tearDown();
}
@Test
public void testSimpleJMSXDeliveryCount() throws Exception
@ -60,7 +89,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
try
{
conn = getConnectionFactory().createConnection();
conn = cf.createConnection();
Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer p = s.createProducer(queue1);
p.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
@ -76,19 +105,19 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
TextMessage tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("xoxo", tm.getText());
ProxyAssertSupport.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
Assert.assertEquals("xoxo", tm.getText());
Assert.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
tm.propertyExists("JMSXDeliveryCount"));
ProxyAssertSupport.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
s.recover();
tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("xoxo", tm.getText());
ProxyAssertSupport.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
Assert.assertEquals("xoxo", tm.getText());
Assert.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
tm.propertyExists("JMSXDeliveryCount"));
ProxyAssertSupport.assertEquals(2, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(2, tm.getIntProperty("JMSXDeliveryCount"));
tm.acknowledge();
@ -110,7 +139,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
try
{
conn = getConnectionFactory().createConnection();
conn = cf.createConnection();
Session s = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
@ -128,9 +157,9 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
TextMessage tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("message1", tm.getText());
ProxyAssertSupport.assertFalse(tm.getJMSRedelivered());
ProxyAssertSupport.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals("message1", tm.getText());
Assert.assertFalse(tm.getJMSRedelivered());
Assert.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
s.close();
@ -140,33 +169,33 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("message1", tm.getText());
ProxyAssertSupport.assertTrue(tm.getJMSRedelivered());
ProxyAssertSupport.assertEquals(2, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals("message1", tm.getText());
Assert.assertTrue(tm.getJMSRedelivered());
Assert.assertEquals(2, tm.getIntProperty("JMSXDeliveryCount"));
tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("message2", tm.getText());
ProxyAssertSupport.assertFalse(tm.getJMSRedelivered());
ProxyAssertSupport.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals("message2", tm.getText());
Assert.assertFalse(tm.getJMSRedelivered());
Assert.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("message3", tm.getText());
ProxyAssertSupport.assertFalse(tm.getJMSRedelivered());
ProxyAssertSupport.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals("message3", tm.getText());
Assert.assertFalse(tm.getJMSRedelivered());
Assert.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("message4", tm.getText());
ProxyAssertSupport.assertFalse(tm.getJMSRedelivered());
ProxyAssertSupport.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals("message4", tm.getText());
Assert.assertFalse(tm.getJMSRedelivered());
Assert.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
tm = (TextMessage)c.receive(1000);
ProxyAssertSupport.assertEquals("message5", tm.getText());
ProxyAssertSupport.assertFalse(tm.getJMSRedelivered());
ProxyAssertSupport.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals("message5", tm.getText());
Assert.assertFalse(tm.getJMSRedelivered());
Assert.assertEquals(1, tm.getIntProperty("JMSXDeliveryCount"));
tm.acknowledge();
}
@ -186,7 +215,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
try
{
conn = getConnectionFactory().createConnection();
conn = cf.createConnection();
Session sess1 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
@ -218,11 +247,11 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
for (int i = 0; i < NUM_MESSAGES; i++)
{
tm = (TextMessage)cons.receive(3000);
ProxyAssertSupport.assertNotNull(tm);
ProxyAssertSupport.assertEquals("testing" + i, tm.getText());
ProxyAssertSupport.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
Assert.assertNotNull(tm);
Assert.assertEquals("testing" + i, tm.getText());
Assert.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
tm.propertyExists("JMSXDeliveryCount"));
ProxyAssertSupport.assertEquals(j + 1, tm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(j + 1, tm.getIntProperty("JMSXDeliveryCount"));
}
if (j != NUM_RECOVERIES - 1)
{
@ -248,7 +277,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
try
{
conn = getConnectionFactory().createConnection();
conn = cf.createConnection();
conn.setClientID("myclientid");
@ -256,9 +285,9 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
Session sess2 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Session sess3 = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
MessageConsumer cons1 = sess1.createConsumer(ActiveMQServerTestCase.topic1);
MessageConsumer cons2 = sess2.createConsumer(ActiveMQServerTestCase.topic1);
MessageConsumer cons3 = sess3.createDurableSubscriber(ActiveMQServerTestCase.topic1, "subxyz");
MessageConsumer cons1 = sess1.createConsumer(topic1);
MessageConsumer cons2 = sess2.createConsumer(topic1);
MessageConsumer cons3 = sess3.createDurableSubscriber(topic1, "subxyz");
conn.start();
@ -278,7 +307,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
t3.start();
Session sessSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer prod = sessSend.createProducer(ActiveMQServerTestCase.topic1);
MessageProducer prod = sessSend.createProducer(topic1);
prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
for (int i = 0; i < NUM_MESSAGES; i++)
@ -291,9 +320,9 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
t2.join();
t3.join();
ProxyAssertSupport.assertFalse(r1.failed);
ProxyAssertSupport.assertFalse(r2.failed);
ProxyAssertSupport.assertFalse(r3.failed);
Assert.assertFalse(r1.failed);
Assert.assertFalse(r2.failed);
Assert.assertFalse(r3.failed);
cons3.close();
@ -315,7 +344,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
try
{
conn = getConnectionFactory().createConnection();
conn = cf.createConnection();
Session producerSess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = producerSess.createProducer(queue1);
@ -330,39 +359,39 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
TextMessage rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
Assert.assertTrue("JMSXDeliveryCount is supposed to exist as a property",
tm.propertyExists("JMSXDeliveryCount"));
ProxyAssertSupport.assertEquals(1, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(1, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertFalse(rm.getJMSRedelivered());
Assert.assertFalse(rm.getJMSRedelivered());
consumerSess.rollback();
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(2, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(2, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
consumerSess.rollback();
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(3, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(3, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
// Now close the session without committing
@ -374,13 +403,13 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(4, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(4, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
consumerSess.commit();
}
@ -400,7 +429,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
try
{
conn = getConnectionFactory().createConnection();
conn = cf.createConnection();
Session producerSess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = producerSess.createProducer(queue1);
@ -415,37 +444,37 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
TextMessage rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(1, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(1, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertFalse(rm.getJMSRedelivered());
Assert.assertFalse(rm.getJMSRedelivered());
consumerSess.recover();
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(2, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(2, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
consumerSess.recover();
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(3, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(3, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
// Now close the session without committing
@ -457,13 +486,13 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(4, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(4, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
rm.acknowledge();
}
@ -492,7 +521,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
{
toResume = mgr.suspend();
conn = getConnectionFactory().createConnection();
conn = cf.createConnection();
// Send a message
@ -503,7 +532,7 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
producer.send(tm);
xaConn = getXAConnectionFactory().createXAConnection();
xaConn = xacf.createXAConnection();
XASession consumerSess = xaConn.createXASession();
MessageConsumer consumer = consumerSess.createConsumer(queue1);
@ -521,13 +550,13 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
TextMessage rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(1, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(1, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertFalse(rm.getJMSRedelivered());
Assert.assertFalse(rm.getJMSRedelivered());
tx.delistResource(res, XAResource.TMSUCCESS);
@ -545,13 +574,13 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(2, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(2, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
tx.delistResource(res, XAResource.TMSUCCESS);
@ -569,13 +598,13 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(3, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(3, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
tx.delistResource(res, XAResource.TMSUCCESS);
@ -603,13 +632,13 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
rm = (TextMessage)consumer.receive(1000);
ProxyAssertSupport.assertNotNull(rm);
Assert.assertNotNull(rm);
ProxyAssertSupport.assertEquals(tm.getText(), rm.getText());
Assert.assertEquals(tm.getText(), rm.getText());
ProxyAssertSupport.assertEquals(4, rm.getIntProperty("JMSXDeliveryCount"));
Assert.assertEquals(4, rm.getIntProperty("JMSXDeliveryCount"));
ProxyAssertSupport.assertTrue(rm.getJMSRedelivered());
Assert.assertTrue(rm.getJMSRedelivered());
tx.delistResource(res, XAResource.TMSUCCESS);
@ -697,15 +726,11 @@ public class JMSXDeliveryCountTest extends ActiveMQServerTestCase
if (!tm.getText().equals("testing" + i))
{
log.error("Out of order!!");
failed = true;
}
if (tm.getIntProperty("JMSXDeliveryCount") != j + 1)
{
log.error("DeliveryImpl count not expected value:" + (j + 1) +
" actual:" +
tm.getIntProperty("JMSXDeliveryCount"));
failed = true;
}
}

View File

@ -137,6 +137,8 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>

View File

@ -18,6 +18,8 @@ package org.apache.activemq.tests.integration.openwire;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.InvalidDestinationException;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
@ -30,10 +32,15 @@ import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
public class SimpleOpenWireTest extends BasicOpenWireTest
{
@Rule
public ExpectedException thrown = ExpectedException.none();
@Override
@Before
public void setUp() throws Exception
@ -220,8 +227,34 @@ public class SimpleOpenWireTest extends BasicOpenWireTest
session.close();
}
@Test
public void testInvalidDestinationExceptionWhenNoQueueExistsOnCreateProducer() throws Exception
{
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createQueue("fake.queue");
thrown.expect(InvalidDestinationException.class);
thrown.expect(JMSException.class);
session.createProducer(queue);
session.close();
}
@Test
public void testInvalidDestinationExceptionWhenNoTopicExistsOnCreateProducer() throws Exception
{
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destination = session.createTopic("fake.queue");
thrown.expect(InvalidDestinationException.class);
session.createProducer(destination);
session.close();
}
/**
* This is the example shipped with the distribution
*
* @throws Exception
*/
@Test

View File

@ -105,6 +105,9 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
@ -114,11 +117,6 @@
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.jbossts.jts</groupId>
<artifactId>jbossjts-jacorb</artifactId>
<version>4.17.13.Final</version>
</dependency>
</dependencies>
<build>

View File

@ -29,7 +29,6 @@ import javax.jms.Topic;
import javax.jms.TopicConnectionFactory;
import javax.jms.XAConnectionFactory;
import javax.naming.InitialContext;
import javax.transaction.TransactionManager;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
@ -37,7 +36,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.jms.JMSFactoryType;
import org.apache.activemq.core.postoffice.Binding;
@ -362,21 +360,6 @@ public abstract class ActiveMQServerTestCase
return (XAConnectionFactory) getInitialContext().lookup("/CF_XA_TRUE");
}
public InitialContext getInitialContext(final int serverid) throws Exception
{
return new InitialContext(ServerManagement.getJNDIEnvironment(serverid));
}
protected TransactionManager getTransactionManager()
{
return new TransactionManagerImple();
}
public void configureSecurityForDestination(final String destName, final boolean isQueue, final HashSet<Role> roles) throws Exception
{
ActiveMQServerTestCase.servers.get(0).configureSecurityForDestination(destName, isQueue, roles);
}
public void createQueue(final String name) throws Exception
{
ActiveMQServerTestCase.servers.get(0).createQueue(name, null);

View File

@ -60,13 +60,6 @@
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.activemq.tests</groupId>
<artifactId>jms-tests</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-jms-client</artifactId>

View File

@ -78,10 +78,12 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!--
JBoss Logging
-->