Hi @amackenzie,
I am using the code samples mentioned here: Persistence with Queues
Only difference in my Producer code is I am creating objects such as Session, Producer, Message outside the loop and setting message and sending repeatedly inside the loop:
String queueName = “Q/tutorial”;
final Queue queue = JCSMPFactory.onlyInstance().createQueue(queueName);
TextMessage msg = JCSMPFactory.onlyInstance().createMessage(TextMessage.class);
msg.setDeliveryMode(DeliveryMode.PERSISTENT);XMLMessageProducer prod = session.getMessageProducer(new JCSMPStreamingPublishEventHandler() { @Override public void responseReceived(String messageID) { System.out.println("Producer received response for msg: " + messageID); } @Override public void handleError(String messageID, JCSMPException e, long timestamp) { System.out.printf("Producer received error for msg: %s@%s - %s%n",messageID,timestamp,e); }});
while(true) {
String text = "Persistent Queue Tutorial! " + DateFormat.getDateTimeInstance().format(new Date());
msg.setText(text);
prod.send(msg, queue);
sleep(100); //ms
}
Consumer is exactly same as mentioned in the above link. Also, queue has been provisioned with appropriate permissions from CLI.
@Aaron - I am running both Producer and Consumer on the same host. Also, the minimum latency that is observed is 1.1 ms NOT in nano seconds as you mentioned.