Websphere和MQ作为JMS提供者:丢失消息

时间:2016-10-18 00:06:50

标签: jms ibm-mq websphere-8 mq

我们正在使用以下

Websphere 8.0.0.10

MQ作为JMS提供程序

我有一个MDB将消息放到另一个这样的队列中(由另一个消息触发)

    if (connectionFactory == null) {
        throw new BatchProcessException("connectionFactory injection failed");
    }
    if (queue == null) {
        throw new BatchProcessException("queue injection failed");
    }

    List<Customer> customers = getAllCustomers();

    if (customers != null && customers.size() > 0) {

        try {
            connection = connectionFactory.createConnection();
            connection.start();

            for (Customer customer : customers) {


                Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageProducer producer = session.createProducer(queue);
                producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
                TextMessage textMessage = session.createTextMessage(customer.toString());
                producer.send(textMessage);
                session.close();
            }
        } catch (JMSException e) {
            LOG.error("error", e);
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                    connection = null;
                } catch (JMSException e) {
                    LOG.error("error closing mq connection", e);
                }
            }
        }

如您所见,此代码在循环中运行并创建和发送消息。 所有这些对我们来说在较低的环境中工作正常,但在另一个环境中,我们达到了10000 msgs的限制,只允许这样。不知道其他消息在哪里消失了。我们检查了最大队列深度和MAXUMSGS。队列管理器的事务日志大小也相同。不幸的是,在MDB中运行的代码没有任何异常。请有人请说清楚。任何迅速的回应将不胜感激。寻求的任何细节都将立即提供。

我不是MQ专家,但我们已将Websphere配置为异步放置消息。对于NON_PERSISTENT消息和NOT_TRANSACTED会话意味着什么,如果有人可以解释也会非常有用。

0 个答案:

没有答案