【问题标题】:How to NOT send an assured message via solace JMS如何不通过 solace JMS 发送有保证的消息
【发布时间】:2016-08-23 20:18:29
【问题描述】:

我有一个非常简单的生产者类型程序,它尝试向主题发送 ByteMessage。

我的程序收到错误com.solacesystems.jms.ConfigurationException: Error sending message - operation not supported on router (Cannot send assured message: Assured message delivery is not enabled on this channel.)

如何确保发送的消息不是有保证的消息?这是一些安慰配置变量吗?这是我尝试使用的简单 JMS 相关代码,其中bytes 是我要发送的对象:

val connection = connectionFactory.createConnection()
val session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE)
val publishDestination = session.createTopic(solace.TOPIC)
val message = new SolBytesMessage()
message.writeBytes(bytes)
val producer = session.createProducer(publishDestination)
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT)
log.info("Sending message")
producer.send(publishDestination, message)

【问题讨论】:

    标签: scala jms solace


    【解决方案1】:

    请确认Direct Transport 已在设备的连接出厂设置中选中。

    连接工厂中的Direct Transport 设置控制用于非持久消息的传输。

    【讨论】:

    • 有没有办法在不启用直接传输的情况下发送消息?
    • 这并没有 100% 解决我的问题,但是通过 solace 客户端更改我的设置是解决方案。
    【解决方案2】:

    这可以通过执行 QOS 来解决:

        JmsTemplate jmsTemplate = new JmsTemplate(cachingConnectionFactory);
        jmsTemplate.setDefaultDestinationName(topic);
        jmsTemplate.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
        jmsTemplate.setExplicitQosEnabled(true);
    

    【讨论】:

      猜你喜欢
      • 2015-08-25
      • 2011-06-19
      • 2012-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多