I’m using Oracle AQ With below consumer code in Java.
Why the queue still remains in the database. What call do I need to make so that queue will get removed once it is consumed?
QueueConnection myqueue = getConnection();
Session session = myqueue.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
myqueue.start();
queue = ((AQjmsSession) session).getQueue("demo", "myqueue");
MessageConsumer consumer = session.createConsumer(queue);
TextMessage msg = (TextMessage) consumer.receive();
System.out.println("message" + msg.getText());
consumer.close();
session.close();
myqueue.close();
Thanks!
Maybe I’m wrong, but its not the queue that gets consumed, its the messages that go into the queue that get consumed. The queue is just a table, no? You could explicitly “DROP TABLE MYQUEUE” once you are sure that no producer or consumer expects it to exist.