Changeset 2983

Show
Ignore:
Timestamp:
08/20/10 11:01:03
Author:
douglm
Message:

Use a system variable to set activemq bedework broker uri - changes all configs
Change startjboss scripts to allow setting of activemquri at startup.
Also allow setting of portoffset

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/quickstart/linux/startjboss

    r2849 r2983  
    1111usage() { 
    1212  echo "  $PRG [-heap size] [-newsize size] [-permgen size] [-debug]" 
    13   echo "       [-debugmodule name]
     13  echo "       [-debugmodule name] [-activemquri uri]
    1414  echo "" 
    1515  echo " Where:" 
     
    1919  echo "                                        nM for mega-bytes (e.g. 2560M)" 
    2020  echo "                                        nG for giga-bytes (e.g. 1G)" 
     21  echo "  Default: $heap" 
    2122  echo "" 
    2223  echo " -newsize sets the new generation size and has the same form as -heap" 
    2324  echo "  the value should be around one third of the heap" 
     25  echo "  Default: $newsize" 
    2426  echo "" 
    2527  echo " -permsize sets the permgen size and has the same form as -heap" 
    2628  echo "  The value should probably not be less than 256M" 
     29  echo "  Default: $permsize" 
    2730  echo "" 
    2831  echo " -debug sets the logging level to DEBUG" 
     
    3235  echo "  may be referenced by the log4j configuration" 
    3336  echo "" 
    34   echo "Default settings:" 
    35   echo "heap     = $heap"  
    36   echo "newsize  = $newsize" 
    37   echo "permsize = $permsize" 
     37  echo " -activemquri sets the uri used by the activemq broker for bedework" 
     38  echo "  Some possibilities: vm://localhost tcp://localhost:61616" 
     39  echo "  Default: $activemquri" 
     40  echo "" 
     41  echo " -portoffset sets the offset for the standard jboss ports allowing" 
     42  echo "  multiple instances to be run on the same machine. The activemquri" 
     43  echo "  value may need to be set explicitly if it uses a port." 
     44  echo "  Default: $portoffset" 
    3845  echo "" 
    3946} 
    4047 
     48# ===================== Defaults ================================= 
    4149heap="600M" 
    4250newsize="200M" 
    4351permsize="256M" 
     52 
     53portoffset=0 
     54 
     55activemquri="vm://localhost" 
     56 
     57# =================== End defaults =============================== 
    4458 
    4559LOG_THRESHOLD="-Djboss.server.log.threshold=INFO" 
     
    5468      usage 
    5569      exit 
    56       shift 
    5770      ;; 
    5871    -heap)         # Heap size bytes or nK, nM, nG 
     
    8093      shift 
    8194      ;; 
     95    -portoffset) 
     96      shift 
     97      portoffset="$1" 
     98      shift 
     99      ;; 
     100    -activemquri) 
     101      shift 
     102      activemquri="$1" 
     103      shift 
     104      ;; 
    82105    *) 
    83106      usage 
     
    101124 
    102125# standard ports 
    103 JBOSS_PORTS=-Dorg.bedework.system.ports.offset=0 
     126JBOSS_PORTS=-Dorg.bedework.system.ports.offset=$portoffset 
    104127 
    105128# standard ports + defined value 
     
    107130 
    108131ACTIVEMQ_DIRPREFIX="-Dorg.apache.activemq.default.directory.prefix=$JBOSS_DATA_DIR/" 
     132ACTIVEMQ_URI="-Dorg.bedework.activemq.uri=$activemquri" 
    109133 
    110134BW_DATA_DIR=$JBOSS_DATA_DIR/bedework 
     
    115139export JAVA_OPTS="$JAVA_OPTS -XX:PermSize=$permsize -XX:MaxPermSize=$permsize" 
    116140 
    117 RUN_CMD="./$JBOSS_VERSION/bin/run.sh -c $JBOSS_CONFIG $JBOSS_BIND $JBOSS_PORTS $LOG_THRESHOLD $LOG_LEVELS $ACTIVEMQ_DIRPREFIX $BW_DATA_DIR_DEF" 
     141RUN_CMD="./$JBOSS_VERSION/bin/run.sh -c $JBOSS_CONFIG $JBOSS_BIND $JBOSS_PORTS $LOG_THRESHOLD $LOG_LEVELS $ACTIVEMQ_DIRPREFIX $ACTIVEMQ_URI $BW_DATA_DIR_DEF" 
    118142 
    119143echo $RUN_CMD 
  • trunk/build/quickstart/windows/startjboss.bat

    r2849 r2983  
    1313SET newsize=200M 
    1414SET permsize=256M 
     15 
     16SET activemquri=vm://localhost 
     17 
     18SET portoffset=0 
    1519 
    1620GOTO branch 
     
    3438  GOTO branch 
    3539 
     40:portoffset 
     41  SHIFT 
     42  SET portoffset=%1 
     43  SHIFT 
     44  GOTO branch 
     45 
     46:activemquri 
     47  SHIFT 
     48  SET activemquri=%1 
     49  SHIFT 
     50  GOTO branch 
     51 
    3652:doneWithArgs 
    3753 
     
    5066 
    5167:: standard ports 
    52 SET JBOSS_PORTS=-Dorg.bedework.system.ports.offset=0 
     68SET JBOSS_PORTS=-Dorg.bedework.system.ports.offset=%portoffset% 
    5369 
    5470:: standard ports + defined value 
     
    5672 
    5773SET ACTIVEMQ_DIRPREFIX=-Dorg.apache.activemq.default.directory.prefix=%JBOSS_DATA_DIR%\ 
     74SET ACTIVEMQ_URI=-Dorg.bedework.activemq.uri=%activemquri% 
    5875 
    5976SET LOG_THRESHOLD=-Djboss.server.log.threshold=DEBUG 
     
    6683SET JAVA_OPTS=%JAVA_OPTS% -XX:PermSize=%permsize% -XX:MaxPermSize=%permsize% 
    6784 
    68 SET RUN_CMD=.\%JBOSS_VERSION%\bin\run.bat -c %JBOSS_CONFIG% %JBOSS_BIND% %JBOSS_PORTS% %LOG_THRESHOLD% %ACTIVEMQ_DIRPREFIX% %BW_DATA_DIR_DEF% 
     85SET RUN_CMD=.\%JBOSS_VERSION%\bin\run.bat -c %JBOSS_CONFIG% %JBOSS_BIND% %JBOSS_PORTS% %LOG_THRESHOLD% %ACTIVEMQ_DIRPREFIX% %ACTIVEMQ_URI% %BW_DATA_DIR_DEF% 
    6986 
    7087ECHO. 
     
    86103IF "%1" == "-newsize" GOTO newsize 
    87104IF "%1" == "-permsize" GOTO permsize 
     105IF "%1" == "-portoffset" GOTO portoffset 
     106IF "%1" == "-activemquri" GOTO activemquri 
    88107GOTO doneWithArgs 
    89108  
     
    93112ECHO. 
    94113ECHO startjboss.bat [-heap size] [-newsize size] [-permsize size] 
     114ECHO                [-portoffset n] [-activemquri uri] 
    95115ECHO. 
    96116ECHO Where: 
     
    100120ECHO                                        nM for mega-bytes (e.g. 256oM) 
    101121ECHO                                        nG for giga-bytes (e.g. 1G) 
     122ECHO. Default: %heap% 
    102123ECHO. 
    103124ECHO -newsize sets the new generation size and has the same form as -heap 
    104125ECHO  the value should be around one third of the heap 
     126ECHO. Default: %newsize% 
    105127ECHO. 
    106128ECHO -permsize sets the permgen size and has the same form as -heap 
    107129ECHO   The value should probably not be less than 256M 
     130ECHO. Default: %permsize% 
    108131ECHO. 
     132ECHO. -activemquri sets the uri used by the activemq broker for bedework 
     133ECHO.  Some possibilities: vm://localhost tcp://localhost:61616 
     134ECHO.  Default: %activemquriDefault% 
    109135ECHO. 
    110 ECHO. Default settings: 
    111 ECHO. heap    = %heap% 
    112 ECHO. newsize = %newsize% 
    113 ECHO. permgen = %permsize% 
     136ECHO. -portoffset sets the offset for the standard jboss ports allowing 
     137ECHO.  multiple instances to be run on the same machine. The activemquri 
     138ECHO.  value may need to be set explicitly if it uses a port. 
     139ECHO.  Default: %portoffset% 
     140ECHO. 
  • trunk/config/bwbuild/jboss-h2/activemq-broker-config.xml

    r2976 r2983  
    196196    <!-- The transport connectors ActiveMQ will listen to --> 
    197197    <transportConnectors> 
     198      <transportConnector name="bedework"  
     199                          uri="${org.bedework.activemq.uri}" /> 
     200      <!-- 
    198201      <transportConnector name="bedework" uri="tcp://localhost:61616" /> 
    199       <!-- 
    200202        According to the book we shouldn't specify a discoveryUri - can lead to 
    201203        multiple activemq brokers eating each others messages, At the very least 
     
    209211 
    210212  <!-- 
    211   ** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
     213  ** Lets dseploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
    212214  ** For more details see 
    213215  ** 
  • trunk/config/bwbuild/jboss-h2/activemq-jms-ds.xml

    r2832 r2983  
    1313      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    1414      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    15       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     15 
     16      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
     17      <!--  
     18      <ServerUrl>failover:(tcp://localhost:61616)?timeout=3000</ServerUrl> 
     19      -->       
    1620      <!-- 
    1721      <UserName>sa</UserName> 
     
    3034      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    3135      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    32       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     36 
     37      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    3338      <!-- 
    3439      <UserName>sa</UserName> 
     
    4752      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    4853      <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> 
    49       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     54 
     55      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    5056      <!-- 
    5157      <UserName>sa</UserName> 
  • trunk/config/bwbuild/jboss-h2/activemq-ra.xml

    r2832 r2983  
    243243            <config-property-name>ServerUrl</config-property-name> 
    244244            <config-property-type>java.lang.String</config-property-type> 
    245             <config-property-value>tcp://localhost:61616</config-property-value> 
     245            <config-property-value>${org.bedework.activemq.uri}</config-property-value> 
    246246        </config-property> 
    247247        <config-property> 
  • trunk/config/bwbuild/jboss-mysql/activemq-broker-config.xml

    r2976 r2983  
    196196    <!-- The transport connectors ActiveMQ will listen to --> 
    197197    <transportConnectors> 
     198      <transportConnector name="bedework"  
     199                          uri="${org.bedework.activemq.uri}" /> 
     200      <!-- 
    198201      <transportConnector name="bedework" uri="tcp://localhost:61616" /> 
    199       <!-- 
    200202        According to the book we shouldn't specify a discoveryUri - can lead to 
    201203        multiple activemq brokers eating each others messages, At the very least 
     
    209211 
    210212  <!-- 
    211   ** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
     213  ** Lets dseploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
    212214  ** For more details see 
    213215  ** 
  • trunk/config/bwbuild/jboss-mysql/activemq-jms-ds.xml

    r2777 r2983  
    1313      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    1414      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    15       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     15 
     16      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
     17      <!--  
     18      <ServerUrl>failover:(tcp://localhost:61616)?timeout=3000</ServerUrl> 
     19      -->       
    1620      <!-- 
    1721      <UserName>sa</UserName> 
     
    3034      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    3135      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    32       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     36 
     37      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    3338      <!-- 
    3439      <UserName>sa</UserName> 
     
    4752      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    4853      <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> 
    49       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     54 
     55      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    5056      <!-- 
    5157      <UserName>sa</UserName> 
  • trunk/config/bwbuild/jboss-mysql/activemq-ra.xml

    r2777 r2983  
    243243            <config-property-name>ServerUrl</config-property-name> 
    244244            <config-property-type>java.lang.String</config-property-type> 
    245             <config-property-value>tcp://localhost:61616</config-property-value> 
     245            <config-property-value>${org.bedework.activemq.uri}</config-property-value> 
    246246        </config-property> 
    247247        <config-property> 
  • trunk/config/bwbuild/jboss-postgresql/activemq-broker-config.xml

    r2978 r2983  
    196196    <!-- The transport connectors ActiveMQ will listen to --> 
    197197    <transportConnectors> 
    198       <transportConnector name="bedework" uri="tcp://localhost:61616" /> 
     198      <transportConnector name="bedework"  
     199                          uri="${org.bedework.activemq.uri}" /> 
    199200      <!-- 
    200201      <transportConnector name="bedework" uri="tcp://localhost:61616" /> 
     
    210211 
    211212  <!-- 
    212   ** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
     213  ** Lets dseploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
    213214  ** For more details see 
    214215  ** 
  • trunk/config/bwbuild/jboss-postgresql/activemq-jms-ds.xml

    r2978 r2983  
    1414      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    1515 
    16       <ServerUrl>failover:(tcp://localhost:61616)?timeout=3000</ServerUrl> 
     16      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    1717      <!--  
    1818      <ServerUrl>failover:(tcp://localhost:61616)?timeout=3000</ServerUrl> 
     
    3535      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    3636 
    37       <ServerUrl>failover:(tcp://localhost:61616)?timeout=3000</ServerUrl> 
     37      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    3838      <!-- 
    3939      <UserName>sa</UserName> 
     
    5353      <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> 
    5454 
    55       <ServerUrl>failover:(tcp://localhost:61616)?timeout=3000</ServerUrl> 
     55      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    5656      <!-- 
    5757      <UserName>sa</UserName> 
  • trunk/config/bwbuild/jboss-postgresql/activemq-ra.xml

    r2877 r2983  
    243243            <config-property-name>ServerUrl</config-property-name> 
    244244            <config-property-type>java.lang.String</config-property-type> 
    245             <config-property-value>tcp://localhost:61616</config-property-value> 
     245            <config-property-value>${org.bedework.activemq.uri}</config-property-value> 
    246246        </config-property> 
    247247        <config-property> 
  • trunk/config/bwbuild/jboss/activemq-broker-config.xml

    r2976 r2983  
    196196    <!-- The transport connectors ActiveMQ will listen to --> 
    197197    <transportConnectors> 
     198      <transportConnector name="bedework"  
     199                          uri="${org.bedework.activemq.uri}" /> 
     200      <!-- 
    198201      <transportConnector name="bedework" uri="tcp://localhost:61616" /> 
    199       <!-- 
    200202        According to the book we shouldn't specify a discoveryUri - can lead to 
    201203        multiple activemq brokers eating each others messages, At the very least 
     
    209211 
    210212  <!-- 
    211   ** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
     213  ** Lets dseploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker 
    212214  ** For more details see 
    213215  ** 
  • trunk/config/bwbuild/jboss/activemq-jms-ds.xml

    r2755 r2983  
    1313      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    1414      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    15       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     15 
     16      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
     17      <!--  
     18      <ServerUrl>failover:(tcp://localhost:61616)?timeout=3000</ServerUrl> 
     19      -->       
    1620      <!-- 
    1721      <UserName>sa</UserName> 
     
    3034      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    3135      <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> 
    32       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     36 
     37      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    3338      <!-- 
    3439      <UserName>sa</UserName> 
     
    4752      <rar-name>activemq-rar-5.3.0.rar</rar-name> 
    4853      <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> 
    49       <ServerUrl>tcp://localhost:61616</ServerUrl> 
     54 
     55      <ServerUrl>failover:(${org.bedework.activemq.uri})?timeout=3000</ServerUrl> 
    5056      <!-- 
    5157      <UserName>sa</UserName> 
  • trunk/config/bwbuild/jboss/activemq-ra.xml

    r2719 r2983  
    243243            <config-property-name>ServerUrl</config-property-name> 
    244244            <config-property-type>java.lang.String</config-property-type> 
    245             <config-property-value>tcp://localhost:61616</config-property-value> 
     245            <config-property-value>${org.bedework.activemq.uri}</config-property-value> 
    246246        </config-property> 
    247247        <config-property>