在将ActiveMQ HornetQ升级到ActiveMQ Artemis 2.0时,有一些问题需要解决。以下是一些常见问题和解决方法的示例代码:
org.hornetq
hornetq-core-client
2.4.0.Final
org.apache.activemq.artemis
artemis-core-client
2.0.0
// HornetQ ConnectionFactory
ConnectionFactory hornetQConnectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfig);
// Artemis ConnectionFactory
ConnectionFactory artemisConnectionFactory = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfig);
// HornetQ MessageConsumer
MessageConsumer hornetQConsumer = hornetQSession.createConsumer(queue);
// Artemis MessageConsumer
MessageConsumer artemisConsumer = artemisSession.createConsumer(queue);
// HornetQ MessageProducer
MessageProducer hornetQProducer = hornetQSession.createProducer(queue);
// Artemis MessageProducer
MessageProducer artemisProducer = artemisSession.createProducer(queue);
// HornetQ Queue
Queue hornetQQueue = hornetQSession.createQueue("myQueue");
// Artemis Queue
Queue artemisQueue = artemisSession.createQueue("myQueue");
这些代码示例可以帮助您解决在将ActiveMQ HornetQ升级到ActiveMQ Artemis 2.0时遇到的一些常见问题。请注意,根据您的具体应用程序和配置,可能需要进行其他更改和调整。