boolean transacted = false;
Session consumerSession = connection.createSession(transacted, ackMode);
MessageConsumer subscriber = consumerSession.createConsumer(this.topic);
subscriber.setMessageListener(this);
Session producerSession = connection.createSession(transacted, ackMode);
MessageProducer publisher = producerSession.createProducer(this.topic);
connection.start();
for (int i=0; i < this.nmax; i++) {
TextMessage msg = producerSession.createTextMessage();
msg.setText("this is a " + type + " jms message nr. " + i);