wildfly 10、JMS、MDB、主题未接收消息

wildfly 10、JMS、MDB、主题未接收消息,jms,activemq,message-driven-bean,jms-topic,wildfly-10,Jms,Activemq,Message Driven Bean,Jms Topic,Wildfly 10,我有两个消息驱动bean @MessageDriven(name = "SubscribersTopicQueueMDB", activationConfig = { @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/topic/Subscribers"), @ActivationConfigProperty(propertyName = "destinationT

我有两个消息驱动bean

@MessageDriven(name = "SubscribersTopicQueueMDB", activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/topic/Subscribers"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
    @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")})
public class SubscribersTopicQueueMDB implements MessageListener {

    private final static Logger LOGGER = Logger.getLogger(SubscribersTopicQueueMDB.class.toString());

    public SubscribersTopicQueueMDB() {
        System.out.println("Topic: SubscribersTopicQueueMDB  INIT ");
    }

and
@MessageDriven(name = "SubscribersTopicSecondMDB", activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/topic/Subscriber"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
    @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")})
public class SubscribersTopicSecondMDB implements MessageListener {

    private final static Logger LOGGER = Logger.getLogger(SubscribersTopicSecondMDB.class.toString());

    public SubscribersTopicSecondMDB() {
         System.out.println("TOPIC: SubscribersTopicSecondMDB (Second)  INIT ");
    }
当我向主题jms/topic/Subscriber发送消息时,只接收到第一个MDB消息,第二个MDB不接收任何消息。 我该如何改进这一点

我的普通客户

public static void sendTextMessage(String message, String passedDestination) {
        if (message == null || passedDestination == null) {
            return;
        }
        Context namingContext = null;

        try {
            String userName = JMS_DEFAULT_USERNAME;
            String password = JMS_DEFAULT_PASSWORD;
            // Set up the namingContext for the JNDI lookup
            final Properties env = new Properties();
            env.put(Context.INITIAL_CONTEXT_FACTORY, JMS_INITIAL_CONTEXT_FACTORY);
            env.put(Context.PROVIDER_URL, JMS_PROVIDER_URL);
            // env.put(Context.SECURITY_PRINCIPAL, userName);
            // env.put(Context.SECURITY_CREDENTIALS, password);
            namingContext = new InitialContext(env);
            // Perform the JNDI lookups
            String connectionFactoryString = JMS_DEFAULT_CONNECTION_FACTORY;
            System.out.println("+@@Attempting to acquire connection factory \"" + connectionFactoryString + "\"");
            ConnectionFactory connectionFactory = (ConnectionFactory) namingContext.lookup(connectionFactoryString);
            System.out.println("+@@@Found connection factory \"" + connectionFactoryString + "\" in JNDI " + connectionFactory.toString());

            String destinationString = passedDestination;
            System.out.println("+@@Attempting to acquire destination \"" + destinationString + "\"");
            Destination destination = (Destination) namingContext.lookup(destinationString);
            System.out.println("+@@@Found destination \"" + destinationString + "\" in JNDI");

            int count = 2;
            String content = message;
            //System.out.println("userName " + userName);
            //System.out.println("password " + password);
            try (JMSContext context = connectionFactory.createContext()) {
                System.out.println("***************Sending to  " + destinationString + " messages with content: " + content + " *********************");
                 context.createProducer().send(destination, content);

            }
            //return true;
        } catch (NamingException e) {
            e.printStackTrace();
        } finally {
            if (namingContext != null) {
                try {
                    namingContext.close();
                } catch (NamingException e) {
                    e.printStackTrace();
                }
            }
            // return false;
        }

发现我的错误一个主题侦听jms/topic/Subscriber second jms/topic/Subscribers.improved。

发现我的错误一个主题侦听jms/topic/Subscriber second jms/topic/Subscribers.improved