Forum Stats

  • 3,760,221 Users
  • 2,251,664 Discussions
  • 7,871,026 Comments

Discussions

Managing Broker's memory

886634
886634 Member Posts: 14
edited Oct 19, 2011 6:13AM in Java Message Service (JMS)
Hi,

How do I find the amount of memory that is being allocated to the broker and how can I increase it?

Also, are there any general guidelines or personal preferences on what to set imq.system.max_count and imq.system.max_size to? After letting a client application run over night, I noticed the broker was displaying messages that it was entering the yellow state with 81% of its memory being used.

also, is No_ACKNOWLEDGE not a valid mode?
The following code produces the following exception:
TopicSession topicSession = tc.createTopicSession(false, com.sun.messaging.jms.Session.NO_ACKNOWLEDGE);

Exception occurred : javax.jms.JMSException: [C4067]: Invalid session acknowledgement mode: 32768
Cannot connect to broker, exiting...
javax.jms.JMSException: [C4067]: Invalid session acknowledgement mode: 32768
at com.sun.messaging.jmq.jmsclient.SessionImpl.checkAckMode(SessionImpl.java:449)
at com.sun.messaging.jmq.jmsclient.SessionImpl.<init>(SessionImpl.java:391)
at com.sun.messaging.jmq.jmsclient.SessionImpl.<init>(SessionImpl.java:347)
at com.sun.messaging.jmq.jmsclient.UnifiedSessionImpl.<init>(UnifiedSessionImpl.java:70)
at com.sun.messaging.jmq.jmsclient.TopicSessionImpl.<init>(TopicSessionImpl.java:63)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.createTopicSession(ConnectionImpl.java:2996)
at lrvProducer2k.lrvProducer2k.main(lrvProducer2k.java:65)


Thanks in advance!

Edited by: 883631 on Oct 18, 2011 4:59 PM

Answers

  • gimbal2
    gimbal2 Member Posts: 11,949 Gold Trophy
    Well I posted the exception message 'javax.jms.JMSException: [C4067]: Invalid session acknowledgement mode: 32768' into google. It did not give many hits other than this very post, but one of them is this:

    http://markmail.org/message/stkbommhwidzn7g6

    Now this is not very helpful as the first reply with the answer links only to the old sun forums, but it appears the error stems from a wrong createSession() if I read the second reply correctly.


    On the subject of the high memory usage; that smells like a memory leak, but it is impossible to know if this is caused by a bug in the broker or by you somehow triggering it through wrong usage. You'd have to contact people that actually know something about said broker.
  • 883631 wrote:
    Hi,

    How do I find the amount of memory that is being allocated to the broker and how can I increase it?
    This is described in the Oracle GlassFish Server Message Queue 4.5 Administration Guide here:
    http://download.oracle.com/docs/cd/E18930_01/html/821-2438/aeokk.html

    (scroll down to "Java Virtual Machine Adjustments")

    >
    Also, are there any general guidelines or personal preferences on what to set imq.system.max_count and imq.system.max_size to? After letting a client application run over night, I noticed the broker was displaying messages that it was entering the yellow state with 81% of its memory being used.
    These properties are described in the Oracle GlassFish Server Message Queue 4.5 Administration Guide here:
    http://download.oracle.com/docs/cd/E18930_01/html/821-2438/aeocq.html

    You can find general guidance on tuning memory and other aspects in the Oracle GlassFish Server Message Queue 4.5 Administration Guide here:
    http://download.oracle.com/docs/cd/E18930_01/html/821-2438/aeojg.html

    >
    also, is No_ACKNOWLEDGE not a valid mode?
    Not in JMS, no.
    The following code produces the following exception:
    TopicSession topicSession = tc.createTopicSession(false, com.sun.messaging.jms.Session.NO_ACKNOWLEDGE);

    Exception occurred : javax.jms.JMSException: [C4067]: Invalid session acknowledgement mode: 32768
    Cannot connect to broker, exiting...
    javax.jms.JMSException: [C4067]: Invalid session acknowledgement mode: 32768
    at com.sun.messaging.jmq.jmsclient.SessionImpl.checkAckMode(SessionImpl.java:449)
    at com.sun.messaging.jmq.jmsclient.SessionImpl.<init>(SessionImpl.java:391)
    at com.sun.messaging.jmq.jmsclient.SessionImpl.<init>(SessionImpl.java:347)
    at com.sun.messaging.jmq.jmsclient.UnifiedSessionImpl.<init>(UnifiedSessionImpl.java:70)
    at com.sun.messaging.jmq.jmsclient.TopicSessionImpl.<init>(TopicSessionImpl.java:63)
    at com.sun.messaging.jmq.jmsclient.ConnectionImpl.createTopicSession(ConnectionImpl.java:2996)
    at lrvProducer2k.lrvProducer2k.main(lrvProducer2k.java:65)
    This is a special MQ extension to JMS, which is documented in the Oracle GlassFish Server Message Queue 4.5 Developer's Guide for Java Clients
    http://download.oracle.com/docs/cd/E18930_01/html/821-2440/aeqef.html

    As gimbal2 observed, you appear to need to use a special single-arg version of createSession, as shown in the example in the documentation:

    // to create a no ack topic session
    TopicSession noAckTopicSession = ((com.sun.messaging.jms.TopicConnection) topicConnection).createTopicSession(com.sun.messaging.jms.Session.NO_ACKNOWLEDGE);

    Nigel
  • gimbal2
    gimbal2 Member Posts: 11,949 Gold Trophy
    Cool, someone who knows his way around the Glassfish documentation. Very useful links!
This discussion has been closed.