JBoss AS6 FAQ

1. How to create JMS queue/topic in AS6

To create a queue/topic in AS6, you will have to create a *-hornetq-jms.xml with contents like below and place it either 

  • in the JBOSS_HOME/server/<configuration>/deploy folder.
  • in your EJB jar (at root level in the EJB jar or in the subdirectory "META-INF")
<configuration xmlns="urn:hornetq"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">  
    <queue name="MyQueue">  
        <entry name="/queue/myQueue"/>  
    </queue>
</configuration>

You might also edit the global server configuration, which can be found at %JBOSS_HOME%\server\<configuration\deploy\hornetq\hornetq-jms.xml

 For more details, refer to the HornetQ documentation

 

2. How to set default transaction timeout in JBoss AS6

To set default (server) level transaction timeout in JBoss6, edit the following bean in JBOSS_HOME/server/<servername>/deploy/transaction-jboss-beans.xml

<bean name="CoordinatorEnvironmentBean" class="com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean">
   <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.jta:name=CoordinatorEnvironmentBean",
 exposedInterface=com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBeanMBean.class, registerDirectly=true)</annotation>
   <constructor factoryClass="com.arjuna.ats.arjuna.common.arjPropertyManager" factoryMethod="getCoordinatorEnvironmentBean"/>   <property name="enableStatistics">false</property>
   <property name="defaultTimeout">300</property>  
</bean>

As can be seen, the "defaultTimeout" property is set to 300. The value is in seconds. Change it to a value of your choice.

transaction timeout for setting for JBoss5 and Jboss4

Jboss 5.1  JBOSS_HOME/server/<servername>/deploy/transaction-jboss-beans.xml  <property name="transactionTimeout">300</property>

Jboss 4.2/4.3  JBOSS_HOME/server/<servername>/config/JBoss-service.xml

<!-- JBoss Transactions JTA -->
   <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
      name="jboss:service=TransactionManager">
      <attribute name="TransactionTimeout">120</attribute> <!-- timeout in seconds-->
      <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute>
   </mbean>

3. How to change the EJB remote call timeout in JBoss6.

The Timeout when calling a @Remote-EJB-Method from Clients is not affected by the "defaultTimeout"-Property in the transaction-jboss-beans.xml file.

But you can change the timeOut by editing the file JBOSS_HOME/server/<servername>/deploy/ejb3-connectors-jboss-beans.xml

There you can change the line:

<parameter>socket://${hostforurl}:${port}?timeout=300000</parameter>

 

 

reference https://developer.jboss.org/wiki/HowToSetDefaultTransactionTimeoutInJBossAS6

posted @ 2014-09-12 14:37  princessd8251  阅读(300)  评论(0编辑  收藏  举报