Questions:
1.) Is this the “proper” way to programmatically create a permanent queue in solace?
2.) How to properly configure a Solace connection factory environment?
3.) What does the message, TcpClientChannel - Channel Closed (smfclient x) signify?
I am getting a TcpClientChannel - Channel Closed (smfclient x) message after every message I produce to a solace queue. I can see that the queue message counter is increasing in the admin portal, but I would like to know what is causing this issue. I am getting the same message when I try to publish to a topic, but the counter only shows 0. I am using camel-k to produce a message to my solace broker. I used the following code to create a Connection Factory, manually create a session to create a queue.
public class createQueueTest extends RouteBuilder {
public void createQueue() throws Exception{
SolConnectionFactory testFact = SolJmsUtility.createConnectionFactory();
testFact.setHost("tcp://malta.corp.sensis.com:31253");
testFact.setVPN("inder");
testFact.setUsername("default");
testFact.setPassword("");
testFact.setDynamicDurables(true);
Connection connection = testFact.createConnection();
System.out.println("connection created");
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
System.out.println("session created");
Queue queue = session.createQueue("createQueueTest");
System.out.println("Queue created");
session.close();
System.out.println("session closed");
connection.close();
System.out.println("connection closed");
}
@Override
public void configure() throws Exception {
createQueue();
ConnectionFactory testFact =
SolJmsUtility.createConnectionFactory("tcp://malta.corp.sensis.com:31253",
"default","","inder",null);
CamelContext context = getContext();
context.addComponent("test",JmsComponent.jmsComponentAutoAcknowledge(testFact));
from("timer:ticker")
.setBody()
.constant("Hello from Camel-K")
.to(ExchangePattern.InOnly, "test:queue:createQueueTest")
.log("Messsage sent to target 1 :: ${body}");
}
}
I can see that the queue is created in the admin portal and messages queued is increasing. In the terminal output however I am seeing that the connection is being created and closed for every message.
This may be a camel-k issue, where it is creating and closing the session for every message. I have not seen this log message when I publish messages to other JMS Brokers (Artemis), so I am unsure if there is something incorrect with how I’ve set up my connection factories. Possibly something with the environment variables. I am not seeing the channel closed message when I consume from the solace queue though, only when I publish to the queue.
I have not been able to create a topic or publish to a topic in Solace using camel. I get the same logs as above, but I don’t see a topic being created and I don’t see the topic’s messages queued counter increasing when publishing to an existing topic. I do not get an error stating that the topic does not exist though. Any insights into these problems would be greatly appreciated.