'How to NOT send an assured message via solace JMS

I have a very simple producer type program that tries to send a ByteMessage to a topic.

My program is receiving the error 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.)

How do I go about ensuring that the message sent is not an assured message? Is this some solace configuration variable? Here is the simple JMS related code Im trying to use where bytes is the object I'm trying to send:

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)


Solution 1:[1]

Please verify that Direct Transport is checked in the connection factory settings on the appliance.

JMS Connection Factory setting page in SolAdmin's

The Direct Transport setting in the connection factory controls the transport to use for non-persistent messages.

Solution 2:[2]

This can be fixed enforcing QOS:

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

Solution 3:[3]

For anyone finding this question by searching on this error message - if you DO want to send a guaranteed message in this case, leave Direct Transport enabled and edit the client profile on the Solace broker to have "Send Guaranteed Messages" enabled.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Russell Sim
Solution 2 wild_nothing
Solution 3 Alexandra Masse