Yeah 

There relevant parts are in the jbossmq-service.xml.  What im doing it
setting up a jdbc2 pm in oracle.

The attached file is working to a point...

There is an issue where if you shutdown with messages on the queue.  On
restart it tries to load the messages from the PM to the Cache and you
end up trying to write the same row back to the pm table causing an
error.

Ideally what I would like to see (might even do myself) is the
capability to have a PM defined without a MessageCache to be used by the
Cache.

Im also looking at doing a HA Queue/Topic instances... but well see.

-=Brian



On Wed, 2002-10-23 at 17:59, David Jencks wrote:
> On 2002.10.23 18:15:32 -0400 Brian Towles wrote:
> > OK i found it   looks like the MessageCache only needs a reference to
> > the CacheStore name and when its running its startService (in this case
> > at least) it doesnt have to have the PersistenceManager started cause
> > its the PersistenceManager itself which starts a recovery of messages
> > from/for the Cache.
> > 
> > So the config of the MessageCache Mbean only has to have an attribute
> > pointing to the PMs name and not a depend in this case.
> > 
> > 
> > kinda funky
> 
> Really...  Could you post an annotated service.xml file indicating the
> problem very specifically, I think this should be looked into and perhaps
> changed.
> 
> thanks
> david jencks
> > 
> > thx all
> > 
> > -=Brian
> > 
> > 
> > On Wed, 2002-10-23 at 16:32, Brian Towles wrote:
> > > The basic issue is the JDBC2 PersistenceManager then.
> > > 
> > > They way it is designed it implements PersistenceManager  and
> > > CacheStore.  For the MessageCache MBean you define a CacheStore.  And
> > > for the PersistenceManager MBean you define a MessageCache.  The
> > example
> > > for an oracle jdbc2 pm shows the MessageCache pointing to the
> > > PersistenceManager as a CacheStore. Since the jdbc2 PersistenceManager
> > > implements CacheStore this shouldnt be a problem except for the mutual
> > > mbean dependency that crops up.
> > > 
> > > You cant create a second instance of the PersistenceManager with a
> > > different object name cause it would need a MessageCache as well.
> > > 
> > > So the question changes to how do you use the CacheStore in the jdbc2
> > > PersistenceManager and the jdbc2 PersistenceManager?
> > > 
> > > Thanks
> > > -=Brian
> > > 
> > > 
> > > On Wed, 2002-10-23 at 15:30, David Jencks wrote:
> > > > On 2002.10.23 16:22:12 -0400 Brian Towles wrote:
> > > > > Howdy all
> > > > > 
> > > > > Using JBoss 3.0.2
> > > > > 
> > > > > Im trying to setup a jdbc2 persistence for MQ where both the
> > > > > MessageCache uses the PersistenceManager for storage of the cache. 
> > > > > There is an example config file in the source code under
> > > > > messaging/src/etc/server/examples/deploy   but on implementation
> > there
> > > > > message cache and the persistence manager never initialize cause
> > they
> > > > > are waiting on each other.
> > > > > 
> > > > > I know i can nest one Mbean definition inside of another but that
> > > > > doesn't seem to get around the dependencies.
> > > > > 
> > > > > Is there any way to do 2 mbeans dependent on each other in the
> > configs
> > > > 
> > > > No.  One of them has to start first.  If they were mutually dependent
> > > > they'd both have to start first.  AFAIK this is a basic property of
> > time.
> > > > 
> > > > Maybe you can make something else depend on the message cache so you
> > can't
> > > > send messages until it has started?  Otherwise, please describe the
> > problem
> > > > you are trying to solve in more detail.
> > > > 
> > > > thanks
> > > > david jencks
> > > > > 
> > > > > Thanks
> > > > > -=Brian
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > -------------------------------------------------------
> > > > > This sf.net email is sponsored by: Influence the future 
> > > > > of Java(TM) technology. Join the Java Community 
> > > > > Process(SM) (JCP(SM)) program now. 
> > > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> > > > > 
> > > > > _______________________________________________
> > > > > JBoss-user mailing list
> > > > > [EMAIL PROTECTED]
> > > > > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > > > > 
> > > > > 
> > > > 
> > > > 
> > > > -------------------------------------------------------
> > > > This sf.net email is sponsored by: Influence the future 
> > > > of Java(TM) technology. Join the Java Community 
> > > > Process(SM) (JCP(SM)) program now. 
> > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> > > > 
> > > > _______________________________________________
> > > > JBoss-user mailing list
> > > > [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > > 
> > > 
> > > 
> > > 
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by: Influence the future 
> > > of Java(TM) technology. Join the Java Community 
> > > Process(SM) (JCP(SM)) program now. 
> > > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> > > 
> > > _______________________________________________
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This sf.net email is sponsored by: Influence the future 
> > of Java(TM) technology. Join the Java Community 
> > Process(SM) (JCP(SM)) program now. 
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> > 
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > 
> > 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: Influence the future 
> of Java(TM) technology. Join the Java Community 
> Process(SM) (JCP(SM)) program now. 
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user

<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id: jbossmq-service.xml,v 1.1.1.1 2002/08/14 01:56:53 btowles Exp $ -->

<server>

  <!-- ==================================================================== -->
  <!-- JBossMQ                                                              -->
  <!-- ==================================================================== -->


  <!-- ==================================================================== -->
  <!-- Invocation Layers                                                    -->
  <!-- ==================================================================== -->
  <!--
     | InvocationLayers are the different transport methods that can
     | be used to access the server.
   -->

  <mbean code="org.jboss.mq.il.jvm.JVMServerILService"
	 name="jboss.mq:service=InvocationLayer,type=JVM">
    <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>
    <attribute name="ConnectionFactoryJNDIRef">java:/ConnectionFactory</attribute>
    <attribute name="XAConnectionFactoryJNDIRef">java:/XAConnectionFactory</attribute>
    <attribute name="PingPeriod">0</attribute>
  </mbean>

  <mbean code="org.jboss.mq.il.rmi.RMIServerILService"
	 name="jboss.mq:service=InvocationLayer,type=RMI">
	 <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>
    <attribute name="ConnectionFactoryJNDIRef">RMIConnectionFactory</attribute>
    <attribute name="XAConnectionFactoryJNDIRef">RMIXAConnectionFactory</attribute>
    <attribute name="PingPeriod">60000</attribute>
  </mbean>

  <mbean code="org.jboss.mq.il.oil.OILServerILService"
	 name="jboss.mq:service=InvocationLayer,type=OIL">
    <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>
    <attribute name="ConnectionFactoryJNDIRef">ConnectionFactory</attribute>
    <attribute name="XAConnectionFactoryJNDIRef">XAConnectionFactory</attribute>
    <attribute name="ServerBindPort">8090</attribute>
    <attribute name="PingPeriod">60000</attribute>
    <attribute name="EnableTcpNoDelay">true</attribute>
  </mbean>

  <mbean code="org.jboss.mq.il.uil.UILServerILService"
	 name="jboss.mq:service=InvocationLayer,type=UIL">
    <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>
    <attribute name="ConnectionFactoryJNDIRef">UILConnectionFactory</attribute>
    <attribute name="XAConnectionFactoryJNDIRef">UILXAConnectionFactory</attribute>
    <attribute name="ServerBindPort">8091</attribute>
    <attribute name="PingPeriod">60000</attribute>
    <attribute name="EnableTcpNoDelay">true</attribute>
  </mbean>

  <!-- ==================================================================== -->
  <!-- JBossMQ Interceptor chain configuration                              -->
  <!-- ==================================================================== -->
  <!-- To tune performance, you can have the Invoker skip over the TracingInterceptor -->
  <!-- and/or the SecurityManager, but then you loose the ability to trace and/or enforce security. -->
  <mbean code="org.jboss.mq.server.jmx.Invoker" name="jboss.mq:service=Invoker">
    <depends optional-attribute-name="NextInterceptor">jboss.mq:service=TracingInterceptor</depends>
  </mbean>

  <mbean code="org.jboss.mq.server.jmx.InterceptorLoader" name="jboss.mq:service=TracingInterceptor">
    <attribute name="InterceptorClass">org.jboss.mq.server.TracingInterceptor</attribute>
    <depends optional-attribute-name="NextInterceptor">jboss.mq:service=SecurityManager</depends>
  </mbean>

  <mbean code="org.jboss.mq.security.SecurityManager" name="jboss.mq:service=SecurityManager">
    <depends optional-attribute-name="NextInterceptor">jboss.mq:service=DestinationManager</depends>
  </mbean>

  <mbean code="org.jboss.mq.server.jmx.DestinationManager" name="jboss.mq:service=DestinationManager">
    <depends optional-attribute-name="PersistenceManager">jboss.mq:service=PersistenceManager</depends>
    <depends optional-attribute-name="StateManager">jboss.mq:service=StateManager</depends>
  </mbean>

  <!--
     | The MessageCache decides where to put JBossMQ message that
     | are sitting around waiting to be consumed by a client.
     |
     | The memory marks are in Megabytes.  Once the JVM memory usage hits
     | the high memory mark, the old messages in the cache will start getting
     | stored in the DataDirectory.  As memory usage gets closer to the
     | Max memory mark, the amount of message kept in the memory cache aproaches 0.
   -->
  <mbean code="org.jboss.mq.server.MessageCache"
	 name="jboss.mq:service=MessageCache">
    <attribute name="HighMemoryMark">0</attribute>
    <attribute name="MaxMemoryMark">0</attribute>
    <!-- Working Line -->
    <attribute name="CacheStore">jboss.mq:service=PersistenceManager</attribute> 
    <!-- NOT Working Line -->
    <!--depends optional-attribute-name="CacheStore">jboss.mq:service=PersistenceManager</depends--> 
  </mbean>

  <!--
     | The CacheStore decides where to store JBossMQ message that
     | that the MessageCache has decided to move in secondary storage.
  <mbean code="org.jboss.mq.pm.file.CacheStore"
	 name="jboss.mq:service=CacheStore">
    <attribute name="DataDirectory">tmp/jbossmq</attribute>
  </mbean>
   -->

  <!--
     | The StateManager is used to keep JMS persistent state data.
     | For example: what durable subscriptions are active.
   -->
  <mbean code="org.jboss.mq.sm.file.DynamicStateManager"
	 name="jboss.mq:service=StateManager">
    <!-- This file is pulled from the configuration URL of the server -->
    <attribute name="StateFile">jbossmq-state.xml</attribute>
  </mbean>

  <!-- The PersistenceManager is used to store messages to disk. -->
  <!--
  <mbean code="org.jboss.mq.pm.file.PersistenceManager"
	 name="jboss.mq:service=PersistenceManager">
    <attribute name="DataDirectory">db/jbossmq/file</attribute>
    <depends optional-attribute-name="MessageCache">jboss.mq:service=MessageCache</depends>
  </mbean>
  -->

  <!-- 
     | The jdbc2 PersistenceManager is the new improved JDBC implementation.
     | This implementation allows you to control how messages are stored in 
     | the database.
     | 
     | Use this PM if you want the reliablity a relational database can offer 
     | you.  The default configuration is known to work with hsqldb, other databases
     | will requrie teaking of the SqlProperties.
   -->
  <!-- JDBC2 PM for Oracle -->
  <mbean code="org.jboss.mq.pm.jdbc2.PersistenceManager"
	 name="jboss.mq:service=PersistenceManager">
    <depends optional-attribute-name="MessageCache">jboss.mq:service=MessageCache</depends>
    <depends optional-attribute-name="DataSource">jboss.jca:service=LocalTxDS,name=FlyAppTxDatasource</depends>
    <depends>jboss.jca:service=LocalTxCM,name=FlyAppTxDatasource</depends>
    <attribute name="SqlProperties">
      BLOB_TYPE=BINARYSTREAM_BLOB
      INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?)
      INSERT_MESSAGE = INSERT INTO JMS_MESSAGES (MESSAGEID, DESTINATION, MESSAGEBLOB, TXID, TXOP) VALUES(?,?,?,?,?)
      SELECT_ALL_UNCOMMITED_TXS = SELECT TXID FROM JMS_TRANSACTIONS
      SELECT_MAX_TX = SELECT MAX(TXID) FROM JMS_MESSAGES
      SELECT_MESSAGES_IN_DEST = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE DESTINATION=?
      SELECT_MESSAGE = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
      MARK_MESSAGE = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE MESSAGEID=? AND DESTINATION=?
      DELETE_ALL_MESSAGE_WITH_TX = DELETE FROM JMS_MESSAGES WHERE TXID=?
      DELETE_TX = DELETE FROM JMS_TRANSACTIONS WHERE TXID = ?
      DELETE_MARKED_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXID=? AND TXOP=?
      DELETE_MESSAGE = DELETE FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
      CREATE_MESSAGE_TABLE = CREATE TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, \
         DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), \
	 MESSAGEBLOB BLOB, PRIMARY KEY (MESSAGEID, DESTINATION) )
      CREATE_TX_TABLE = CREATE TABLE JMS_TRANSACTIONS ( TXID INTEGER )
    </attribute>
  </mbean> 

  <!-- ==================================================================== -->
  <!-- System Destinations                                                  -->
  <!-- ==================================================================== -->

  <!-- Dead Letter Queue -->
  <mbean code="org.jboss.mq.server.jmx.Queue"
	 name="jboss.mq.destination:service=Queue,name=DLQ">
    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
  </mbean>

</server>

Reply via email to