Hi guys,
I’ve been reading camunda engine’s documentation and it says that I shoud use XA Datasource in production. On the other hand I found that for JBoss deploying you are recommending to use ManagedJtaProcessEngineConfiguration inside the camunda subsystem inside standalone.xml. I got things working so far by using a Jta datasource (non-XA) for camunda. I suppose I’m not right by using this combination, but I don’t know which process engine configuration should I use then…
I attach my standalone, just in case you were so kind to have a look to it and recommend the correct combination. I tried to tweak also the
true property with no success, based upon this article:
mysql - XA Datasource and cockpit - Stack Overflow
My application uses Ejb’s as java delegates for tasks, and mysql as a database, with JBoss EAP 6.4 and Camunda 7.4, and I use JPA and hibernate.
Depending on the combination I use I got the cockpit refreshing the process instances list incorrectly.
Could you help me, please? I ommitted some subsystems in order to be able to create this post.
Thanks in advance.
Here is my standalone:
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:1.6">
<subsystem xmlns="urn:jboss:domain:datasources:1.2">
<datasource jta="true" jndi-name="java:jboss/datasources/EpsilonJtaDS" pool-name="EpsilonJtaDS" enabled="true" use-java-context="true" use-ccm="true" statistics-enabled="true">
<connection-url>jdbc:mysql://localhost:3306/epsilontest-marcel</connection-url>
<driver>mysql</driver>
<new-connection-sql>SELECT 1</new-connection-sql>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>20</min-pool-size>
<max-pool-size>50</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>epsilon</user-name>
<password>epsilon</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>30000</background-validation-millis>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
<timeout>
<set-tx-query-timeout>false</set-tx-query-timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>1</idle-timeout-minutes>
<query-timeout>600</query-timeout>
<use-try-lock>600</use-try-lock>
<allocation-retry>3</allocation-retry>
<allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
</timeout>
<statement>
<track-statements>true</track-statements>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<xa-datasource jndi-name="java:jboss/datasources/EpsilonXADS-common" pool-name="EpsilonXADS-common" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:mysql://localhost:3306/common
</xa-datasource-property>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
<driver>mysql</driver>
<xa-pool>
<min-pool-size>20</min-pool-size>
<max-pool-size>50</max-pool-size>
<pad-xid>false</pad-xid>
<wrap-xa-resource>true</wrap-xa-resource>
</xa-pool>
<security>
<user-name>epsilon</user-name>
<password>epsilon</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>30000</background-validation-millis>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
<timeout>
<set-tx-query-timeout>false</set-tx-query-timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>1</idle-timeout-minutes>
<query-timeout>600</query-timeout>
<use-try-lock>600</use-try-lock>
<allocation-retry>3</allocation-retry>
<allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
</timeout>
<statement>
<track-statements>true</track-statements>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</xa-datasource>
<xa-datasource jndi-name="java:jboss/datasources/EpsilonXADS" pool-name="EpsilonXADS" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:mysql://localhost:3306/epsilontest-marcel
</xa-datasource-property>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
<driver>mysql</driver>
<xa-pool>
<min-pool-size>50</min-pool-size>
<max-pool-size>100</max-pool-size>
<pad-xid>false</pad-xid>
<wrap-xa-resource>true</wrap-xa-resource>
</xa-pool>
<security>
<user-name>epsilon</user-name>
<password>epsilon</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>30000</background-validation-millis>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
<timeout>
<set-tx-query-timeout>false</set-tx-query-timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>1</idle-timeout-minutes>
<query-timeout>600</query-timeout>
<use-try-lock>600</use-try-lock>
<allocation-retry>3</allocation-retry>
<allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
</timeout>
<statement>
<track-statements>true</track-statements>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</xa-datasource>
<drivers>
<driver name="mysql" module="com.mysql.jdbc">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:ee:1.2">
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
<jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>
<annotation-property-replacement>false</annotation-property-replacement>
</subsystem>
<subsystem xmlns="urn:jboss:domain:ejb3:1.4">
<session-bean>
<stateless>
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
</stateless>
<stateful default-access-timeout="5000" cache-ref="simple"/>
<singleton default-access-timeout="5000"/>
</session-bean>
<mdb>
<resource-adapter-ref resource-adapter-name="hornetq-ra"/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" max-pool-size="1000" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
<strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
</bean-instance-pools>
</pools>
<caches>
<cache name="simple" aliases="NoPassivationCache"/>
<cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
</caches>
<passivation-stores>
<file-passivation-store name="file"/>
</passivation-stores>
<async thread-pool-name="default"/>
<timer-service thread-pool-name="default">
<data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
</timer-service>
<remote connector-ref="remoting-connector" thread-pool-name="default"/>
<thread-pools>
<thread-pool name="default">
<max-threads count="128"/>
<keepalive-time time="100" unit="milliseconds"/>
</thread-pool>
</thread-pools>
<default-security-domain value="other"/>
<default-missing-method-permissions-deny-access value="true"/>
<statistics enabled="true"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:infinispan:1.5">
<cache-container name="web" aliases="standard-session-cache" default-cache="local-web" module="org.jboss.as.clustering.web.infinispan" statistics-enabled="true">
<local-cache name="local-web" batching="true" statistics-enabled="true">
<file-store passivation="false" purge="false"/>
</local-cache>
</cache-container>
<cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4" statistics-enabled="true">
<local-cache name="entity" statistics-enabled="true">
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="local-query" statistics-enabled="true">
<transaction mode="NONE"/>
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="timestamps" statistics-enabled="true">
<transaction mode="NONE"/>
<eviction strategy="NONE"/>
</local-cache>
</cache-container>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.1">
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
<bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="128"/>
<queue-length count="100"/>
<max-threads count="192"/>
<keepalive-time time="10" unit="seconds"/>
</short-running-threads>
<long-running-threads>
<core-threads count="128"/>
<queue-length count="100"/>
<max-threads count="192"/>
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
<cached-connection-manager debug="true" error="true"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jpa:1.1">
<jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jsf:1.0"/>
<subsystem xmlns="urn:jboss:domain:mail:1.1">
<mail-session jndi-name="java:jboss/mail/Default">
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
</mail-session>
</subsystem>
<subsystem xmlns="urn:jboss:domain:messaging:1.4">
<hornetq-server>
<persistence-enabled>true</persistence-enabled>
<journal-file-size>102400</journal-file-size>
<journal-min-files>2</journal-min-files>
<connectors>
<netty-connector name="netty" socket-binding="messaging"/>
<netty-connector name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
</netty-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<netty-acceptor name="netty" socket-binding="messaging"/>
<netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
<security-settings>
<security-setting match="#">
<permission type="send" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
</security-setting>
</security-settings>
<address-settings>
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>0</redelivery-delay>
<max-size-bytes>10485760</max-size-bytes>
<address-full-policy>BLOCK</address-full-policy>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
</address-settings>
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
<connection-ttl>-1</connection-ttl>
<call-timeout>30000</call-timeout>
<reconnect-attempts>-1</reconnect-attempts>
</connection-factory>
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="RemoteConnectionFactory"/>
<entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
</entries>
</connection-factory>
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
<pooled-connection-factory name="EpsilonPooledConnFactory">
<transaction mode="xa"/>
<min-pool-size>10</min-pool-size>
<max-pool-size>500</max-pool-size>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/EpsilonPooledConnFactory"/>
</entries>
<connection-ttl>-1</connection-ttl>
<call-timeout>30000</call-timeout>
<reconnect-attempts>-1</reconnect-attempts>
</pooled-connection-factory>
</jms-connection-factories>
<jms-destinations>
<jms-queue name="testQueue">
<entry name="queue/test"/>
<entry name="java:jboss/exported/jms/queue/test"/>
</jms-queue>
<jms-topic name="testTopic">
<entry name="topic/test"/>
<entry name="java:jboss/exported/jms/topic/test"/>
</jms-topic>
</jms-destinations>
</hornetq-server>
</subsystem>
<subsystem xmlns="urn:jboss:domain:naming:1.4">
<remote-naming/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:threads:1.1">
<bounded-queue-thread-pool name="http-executor">
<core-threads count="128"/>
<queue-length count="128"/>
<max-threads count="192"/>
<keepalive-time time="10" unit="seconds"/>
</bounded-queue-thread-pool>
<bounded-queue-thread-pool name="https-executor">
<core-threads count="128"/>
<queue-length count="128"/>
<max-threads count="192"/>
<keepalive-time time="10" unit="seconds"/>
</bounded-queue-thread-pool>
<bounded-queue-thread-pool name="job-executor-tp" allow-core-timeout="true">
<core-threads count="20"/>
<queue-length count="20"/>
<max-threads count="40"/>
<keepalive-time time="30" unit="seconds"/>
</bounded-queue-thread-pool>
</subsystem>
<subsystem xmlns="urn:jboss:domain:transactions:1.5">
<core-environment>
<process-id>
<uuid/>
</process-id>
</core-environment>
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
<coordinator-environment enable-statistics="true" default-timeout="600"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:web:2.1" default-virtual-server="default-host" native="true">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" executor="http-executor" max-connections="600"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true" executor="https-executor" max-connections="600">
<ssl name="ssl" key-alias="epsilon" password="P4ssw0rd" certificate-key-file="${jboss.server.config.dir}/epsilonKey.pem" verify-client="false" certificate-file="${jboss.server.config.dir}/epsilonCert.pem"/>
</connector>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
<subsystem xmlns="urn:jboss:domain:webservices:1.2">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
<endpoint-config name="Standard-Endpoint-Config"/>
<endpoint-config name="Recording-Endpoint-Config">
<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
</pre-handler-chain>
</endpoint-config>
<client-config name="Standard-Client-Config"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:weld:1.0"/>
<subsystem xmlns="urn:org.camunda.bpm.jboss:1.1">
<process-engines>
<process-engine name="default" default="true">
<datasource>
java:jboss/datasources/EpsilonJtaDS
</datasource>
<history-level>
audit
</history-level>
<configuration>
org.camunda.bpm.container.impl.jboss.config.ManagedJtaProcessEngineConfiguration
</configuration>
<properties>
<property name="jobExecutorAcquisitionName">
default
</property>
<property name="isAutoSchemaUpdate">
true
</property>
<property name="authorizationEnabled">
true
</property>
<property name="jobExecutorDeploymentAware">
true
</property>
<property name="executionTreePrefetchEnabled">
false
</property>
</properties>
<plugins>
<plugin>
<class>
org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin
</class>
</plugin>
</plugins>
</process-engine>
</process-engines>
<job-executor>
<thread-pool-name>
job-executor-tp
</thread-pool-name>
<job-acquisitions>
<job-acquisition name="default">
<acquisition-strategy>
SEQUENTIAL
</acquisition-strategy>
<properties>
<property name="lockTimeInMillis">
300000
</property>
<property name="waitTimeInMillis">
5000
</property>
<property name="maxJobsPerAcquisition">
10
</property>
</properties>
</job-acquisition>
</job-acquisitions>
</job-executor>
</subsystem>
</profile>
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<any-address/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
<socket-binding name="ajp" port="8009"/>
<socket-binding name="http" port="8080"/>
<socket-binding name="https" port="8443"/>
<socket-binding name="messaging" port="5445"/>
<socket-binding name="messaging-throughput" port="5455"/>
<socket-binding name="remoting" port="4447"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
<deployments>
<deployment name="epsilon-core.ear" runtime-name="epsilon-core.ear">
<content sha1="68cb8ad94d94aff1969e27f9547164608ce2ae0f"/>
</deployment>
<deployment name="camunda-quickstart-ejb-pa-1.0-SNAPSHOT.war" runtime-name="camunda-quickstart-ejb-pa-1.0-SNAPSHOT.war" enabled="false">
<content sha1="0574e1d62a6c1ac4b6875d4555ba6b4d53d4169b"/>
</deployment>
</deployments>
</server>