1 2 Previous Next 16 Replies Latest reply on Jan 14, 2008 12:59 PM by naql

    Two simple questions about MDBs

    danielherlitz

      1. Is there a way of temporailly stopping an MDB from receiving messages? (For example when a database instance is unavailable and we want to keep the messages in the JMS queue.)

      2. Is it possible to limit the number of MDB instances? (There may be bursts of simultaneous messages and we don't want JBoss to create hundreds of MDB instances)?

      Thanks!

        • 1. Re: Two simple questions about MDBs
          danielherlitz

          About the first question: I suppose I could get a QueueConnection and call stop(). Will try that...

          • 2. Re: Two simple questions about MDBs
            danielherlitz

            regarding the second question:

            I looked at the DTD http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd and thought adding this under in jboss.xml might be a good idea ("1" could be any number):

            <container-configurations>
            <container-configuration>
            <container-name>single</container-name>
            <container-cache-conf>
            <cache-policy-conf>
            <min-capacity>1</min-capacity>
            <max-capacity>1</max-capacity>
            </cache-policy-conf>
            </container-cache-conf>
            </container-configuration>
            </container-configurations>

            It did not help. When I send two messages at roughly the same time to the target queue, JBoss creates two instances of the MDB (System.identityHashCode(this) gives me two different integers). I would really like to find a way of limiting the number of MDB instances.

            • 3. Re: Two simple questions about MDBs
              danielherlitz

              Fulll jboss.xml. Deployed in a jar. just to rule out any misunderstandings. I thought this would limit the number of MyMDB instances to one. It does not.







              <container-configurations>
              <container-configuration>
              <container-name>single</container-name>
              <container-cache-conf>
              <cache-policy-conf>
              <min-capacity>1</min-capacity>
              <max-capacity>1</max-capacity>
              </cache-policy-conf>
              </container-cache-conf>
              </container-configuration>
              </container-configurations>

              <enterprise-beans>
              <message-driven>
              <ejb-name>MyMDB</ejb-name>
              <configuration-name>Standard Message Driven Bean</configuration-name>
              <destination-jndi-name>queue/testQueue</destination-jndi-name>
              </message-driven>
              </enterprise-beans>


              • 4. Re: Two simple questions about MDBs

                Can you stop annoying this forum with your "stream of conciousness" posts.
                We are not interested in watching your fumbling.

                The correct approach to using this forums is:
                requirement -> you
                you -> read docs (chapter 6 for jms)
                you -> read faqs (there is an FAQ on MDB singleton config)
                you -> search mailing lists and this forum for similar questions already answered

                The *wrong* approach
                requirement -> jboss forums
                which will just give you
                jboss forums -> ignores you
                jboss forums -> RTFM

                You must engage your brain before dumping your frivolous questions on the
                community.

                • 5. Re: Two simple questions about MDBs
                  anil.saldhana

                  Everyone at JBoss makes a diligent effort to read user questions and answer. Majority of them are repeated in the forums. So we continously update our wiki pages and also the FAQ at the beginning of the forums. A forum can be healthy only if the same problem is not repeated in posts.

                  The users have to make an effort at reading the wiki pages as well as the FAQ plus search for similar message posts.

                  To undesrtand MDBs/JMS, I suggest doing the following in order:
                  a) Get a good book on JMS/MDBs and learn the concepts from a vendor agnostic perspective. You will understand ejb jars, queues,topics etc.
                  b) Now get into the JBoss details because you want an appserver to do JMS/MDBs. Right? Read the wiki, tutorials and forums. Check out all the settings that go into jboss.xml for MDBs, how to create topics/Queues etc and give it a try. At first, you may not succeed. Only persistence/patience will help. :-)

                  Unless you understand the theory behind JMS/MDBs, there is no point in you trying to deploy them on JBoss. Because you will make simple mistakes and come to the forums for help. People will see that you have a simple/common problem (that is already answered in the forums) and mind their business.

                  Keep the faith. Hey, don't frown - its a friday.



                  • 6. Re: Two simple questions about MDBs
                    danielherlitz

                    Thank you both for your answers.

                    The FAQ on singleton MDBs does not answer my question. (How do I limit the number of bean instances). It works, but it does not answer any questions.

                    Sorry for asking a stupid question again, but when you refer to "chapter 6 for jms", what book is that.




                    • 7. Re: Two simple questions about MDBs

                      I am answering your question to get rid of you.

                      I am not going to answer any further questions from you.
                      You are either lazy, incompetent or just deliberatly annoying.

                      "danielherlitz" wrote:
                      Thank you both for your answers.

                      The FAQ on singleton MDBs does not answer my question. (How do I limit the number of bean instances). It works, but it does not answer any questions.


                      I never intended to answer your questions since they are FAQs.
                      I intended to teach you how to use these forums.
                      Any similarity to an answer you have discerned was entirely unintential on my part.

                      Read my post about using other resources and doing some work
                      yourself rather than expecting the open source community to do it for you.
                      Then you might understand what is happening.

                      I have lost track of how many times I have explained
                      the difference between jms sessions and bean instances in the MDB.
                      Its all in the docs and the spec anyway.

                      There is even a very long thread on the jboss-user mailing list archive where some guy
                      asked how it works in *painful* detail including the transaction and retry semantics.
                      http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg30978.html


                      Sorry for asking a stupid question again, but when you refer to "chapter 6 for jms", what book is that.


                      The big icon on the left hand side of this web page marked "FREE DOCS".
                      Or the menu bar at the top marked "Documentation"
                      etc.

                      • 8. Re: Two simple questions about MDBs
                        danielherlitz

                        I can't understand why my questions make you so angry. Forums are different. Often in forums as a beginner, you can ask stupid questions and get help from other beginners. Obviously not in the JBoss forum. Then what is the point of having a forum if you have to know JBoss in its every detail to dare to ask a question?

                        My stupid questions were:

                        1. Is there a way of temporailly stopping an MDB from receiving messages? (For example when a database instance is unavailable and we want to keep the messages in the JMS queue.)

                        2. Is it possible to limit the number of MDB instances? (There may be bursts of simultaneous messages and we don't want JBoss to create hundreds of MDB instances)?

                        An answer, not just mocking, would help not just me, but all other beginners searching the forums.

                        /D

                        • 9. Re: Two simple questions about MDBs

                          Your latest question was also an FAQ until somebody removed it:
                          http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg44305.html

                          This thread is of no help to other beginners. There are many others where this question
                          was answered but nobody can find them because they have to wade through
                          your (and many others) useless uneducated fumbling.

                          The "Beginners Corner" and the "Getting Started" guide are for people like you.

                          • 10. Re: Two simple questions about MDBs

                            I am not angry. You wouldn't like to see me angry. :-)

                            I am annoyed. Usually a little harsh language is enough to stop this forum absue.
                            Though sometimes people go away with an indignant final post.

                            • 11. Re: Two simple questions about MDBs
                              danielherlitz

                              Instead of wasting so many words on mocking me. Could you not just have answered my question? A URL to a FAQ, a book? Something? Thank you and goodnight.

                              • 12. Re: Two simple questions about MDBs

                                No, you can do some research for yourself then comeback when you have
                                some idea what you talking about.

                                Moved to "useless rants".

                                • 13. Re: Two simple questions about MDBs
                                  chatif

                                  We are also evaluating JBoss for use in our organization. I am scared of even talking to JBoss after reading this post. The user was not ranting here, though he asked some already answered questions. This does not make him deserve an 'uncivilized' mocking and bashing like we see here from so called "Chief Scientist" and other JBoss employees.
                                  I am shocked to see the culture of JBoss company, which seems to be full with just rude 'scientists' with no emphasis to end-users.

                                  If these kinds of posts are troublesome and makes the forum less helpful, then set up a moderator to filter such posts out, instead of making fun of the user.

                                  • 14. Re: Two simple questions about MDBs
                                    sumedh_inamdar

                                    1. I went through the JBoss documentation (JMS chapter) and JMS specification.

                                    2. I tried settings given in

                                    http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMDB

                                    3. There is another thread here on this

                                    http://www.jboss.com/index.html?module=bb&op=viewtopic&t=65445

                                    Still I am not being able to make it work. The server always creates new threads (if others are busy of course) as requests come in.

                                    I understand that I am a novice and configuration must be something very simple, but I have spent about 30 hours on this, so please help me if possible. :(

                                    1 2 Previous Next