I'm creating a queue in Wildlfy 9, this queue will get about 100 or more Messages per seconds, so Im trying to find out which is the best way I can send those messages to the queue, in order to get the best performance(no timeouts or delays). Below is what I have so far, I've tested it and it's worked, to be honest I don't know if I should use Queue Session or not. I just need to send the messages and the MDB will process them.
@Singleton
@Startup
public class JMSUtil {
@Resource(name = "ConnectionFactory")
private QueueConnectionFactory objQueueFactory;
@Resource(name = "jms/queue")
private Queue objQueue;
private JMSContext context;
@PostConstruct
public void init() {
context = objQueueFactory.createContext();
}
@Lock(LockType.READ)
public void sendEvent(String trace) {
context.createProducer().send(objQueue, trace);
}
}