diff --git a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSInjectHandler.java b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSInjectHandler.java index 4498b19afe..b8b3e0519d 100644 --- a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSInjectHandler.java +++ b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSInjectHandler.java @@ -152,9 +152,6 @@ public boolean invoke(Object object, String name) throws SynapseException { } axis2MsgCtx.setProperty(MessageContext.TRANSPORT_HEADERS, transportHeaders); - // set transaction property - axis2MsgCtx.setProperty(BaseConstants.INTERNAL_TRANSACTION_COUNTED, - msg.getBooleanProperty(BaseConstants.INTERNAL_TRANSACTION_COUNTED)); // set the JMS Message ID as the Message ID of the MessageContext try { if (msg.getJMSMessageID() != null) { diff --git a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSUtils.java b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSUtils.java index 876a00dcc9..aa1cc21a8b 100644 --- a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSUtils.java +++ b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/JMSUtils.java @@ -429,10 +429,6 @@ public static Map getTransportHeaders(Message message, MessageCo log.error("Error while reading the Transport Headers from JMS Message", e); } - // remove "INTERNAL_TRANSACTION_COUNTED" header from the transport level headers map. - // this property will be maintained in the message context. Therefore, no need to set this in the transport - // headers. - map.remove(BaseConstants.INTERNAL_TRANSACTION_COUNTED); return map; } diff --git a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ManagementInternalApi.java b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ManagementInternalApi.java index b27f7092ee..d93cd1f83a 100644 --- a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ManagementInternalApi.java +++ b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/ManagementInternalApi.java @@ -101,8 +101,10 @@ public ManagementInternalApi() { resourcesList.add(new ApiResourceAdapter(PREFIX_LOGOUT, new LogoutResource())); resourcesList.add(new ApiResourceAdapter(PREFIX_SERVER_DATA, new MetaDataResource())); resourcesList.add(new LogFilesResource(PREFIX_LOG_FILES)); - resourcesList.add(new ApiResourceAdapter(PREFIX_TRANSACTION + PATH_PARAM_TRANSACTION, - new RequestCountResource())); + + // Disabling this API as the this version of transaction counter is deprecated. + // resourcesList.add(new ApiResourceAdapter(PREFIX_TRANSACTION + PATH_PARAM_TRANSACTION, new RequestCountResource())); + resourcesList.add(new ExternalVaultResource(PREFIX_EXTERNAL_VAULTS + PATH_PARAM_EXTERNAL_VAULT_NAME)); resourcesList.add(new ApiResourceAdapter(PREFIX_DATA_SOURCES, new DataSourceResource())); diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/ServiceBusInitializer.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/ServiceBusInitializer.java index 6209bb3631..374d65d4c1 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/ServiceBusInitializer.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/ServiceBusInitializer.java @@ -58,8 +58,6 @@ import org.wso2.micro.integrator.initializer.deployment.application.deployer.CappDeployer; import org.wso2.micro.integrator.initializer.handler.ProxyLogHandler; import org.wso2.micro.integrator.initializer.handler.SynapseExternalPropertyConfigurator; -import org.wso2.micro.integrator.initializer.handler.transaction.TransactionCountHandler; -import org.wso2.micro.integrator.initializer.handler.transaction.TransactionCountHandlerComponent; import org.wso2.micro.integrator.initializer.persistence.MediationPersistenceManager; import org.wso2.micro.integrator.initializer.services.SynapseConfigurationService; import org.wso2.micro.integrator.initializer.services.SynapseConfigurationServiceImpl; @@ -80,10 +78,7 @@ import java.nio.file.Paths; import java.util.Iterator; import java.util.List; -import java.util.Objects; import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; @@ -111,9 +106,9 @@ public class ServiceBusInitializer { private DataSourceService dataSourceService; - private TransactionCountHandlerComponent transactionCountHandlerComponent; - - private ExecutorService transactionCountExecutor; + // This implementation of transaction counter is deprecated + // private TransactionCountHandlerComponent transactionCountHandlerComponent; + // private ExecutorService transactionCountExecutor; @Activate protected void activate(ComponentContext ctxt) { @@ -198,14 +193,14 @@ protected void activate(ComponentContext ctxt) { synapseEnvironment.registerSynapseHandler(new SynapseExternalPropertyConfigurator()); synapseEnvironment.registerSynapseHandler(new ProxyLogHandler()); - // Register internal transaction synapse handler - boolean transactionPropertyEnabled = TransactionCountHandlerComponent.isTransactionPropertyEnabled(); - if (transactionPropertyEnabled) { - transactionCountHandlerComponent = new TransactionCountHandlerComponent(); - transactionCountHandlerComponent.start(dataSourceService); - transactionCountExecutor = Executors.newFixedThreadPool(100); - synapseEnvironment.registerSynapseHandler(new TransactionCountHandler(transactionCountExecutor)); - } + // This implementation of transaction counter is deprecated + // boolean transactionPropertyEnabled = TransactionCountHandlerComponent.isTransactionPropertyEnabled(); + // if (transactionPropertyEnabled) { + // transactionCountHandlerComponent = new TransactionCountHandlerComponent(); + // transactionCountHandlerComponent.start(dataSourceService); + // transactionCountExecutor = Executors.newFixedThreadPool(100); + // synapseEnvironment.registerSynapseHandler(new TransactionCountHandler(transactionCountExecutor)); + // } if (log.isDebugEnabled()) { log.debug("SynapseEnvironmentService Registered"); } @@ -260,12 +255,15 @@ private String getMainSequenceName(String cappName) { @Deactivate protected void deactivate(ComponentContext ctxt) { - if (Objects.nonNull(transactionCountHandlerComponent)) { - transactionCountHandlerComponent.cleanup(); - } - if (Objects.nonNull(transactionCountExecutor)) { - transactionCountExecutor.shutdownNow(); - } + + // This implementation of transaction counter is deprecated + // if (Objects.nonNull(transactionCountHandlerComponent)) { + // transactionCountHandlerComponent.cleanup(); + // } + // if (Objects.nonNull(transactionCountExecutor)) { + // transactionCountExecutor.shutdownNow(); + // } + List handlers = serverManager.getServerContextInformation().getSynapseEnvironment().getSynapseHandlers(); Iterator iterator = handlers.iterator(); while (iterator.hasNext()) { diff --git a/distribution/src/dbscripts/db2/db2_transaction_count.sql b/distribution/src/dbscripts/db2/db2_transaction_count.sql index 903a8e2ebf..15cfad60ae 100644 --- a/distribution/src/dbscripts/db2/db2_transaction_count.sql +++ b/distribution/src/dbscripts/db2/db2_transaction_count.sql @@ -1,3 +1,4 @@ +-- Related to the deprecated transaction count feature CREATE TABLE IF NOT EXISTS CURRENT_STATS ( TIME_STAMP DATE NOT NULL, NODE_ID VARCHAR(40) NOT NULL, diff --git a/distribution/src/dbscripts/mssql/mssql_transaction_count.sql b/distribution/src/dbscripts/mssql/mssql_transaction_count.sql index 28ea169aa0..c9bd41888a 100644 --- a/distribution/src/dbscripts/mssql/mssql_transaction_count.sql +++ b/distribution/src/dbscripts/mssql/mssql_transaction_count.sql @@ -1,3 +1,4 @@ +-- Related to the deprecated transaction count feature IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CURRENT_STATS]') AND TYPE IN (N'U')) CREATE TABLE CURRENT_STATS ( TIME_STAMP DATE NOT NULL, diff --git a/distribution/src/dbscripts/mysql/mysql_transaction_count.sql b/distribution/src/dbscripts/mysql/mysql_transaction_count.sql index aa84912dc5..3e1badc3a9 100644 --- a/distribution/src/dbscripts/mysql/mysql_transaction_count.sql +++ b/distribution/src/dbscripts/mysql/mysql_transaction_count.sql @@ -1,3 +1,4 @@ +-- Related to the deprecated transaction count feature CREATE TABLE IF NOT EXISTS CURRENT_STATS ( TIME_STAMP DATE NOT NULL, NODE_ID VARCHAR(40) NOT NULL, diff --git a/distribution/src/dbscripts/oracle-rac/oracle_rac_transaction_count.sql b/distribution/src/dbscripts/oracle-rac/oracle_rac_transaction_count.sql index aacef1ef4d..368af2bc52 100644 --- a/distribution/src/dbscripts/oracle-rac/oracle_rac_transaction_count.sql +++ b/distribution/src/dbscripts/oracle-rac/oracle_rac_transaction_count.sql @@ -1,3 +1,4 @@ +-- Related to the deprecated transaction count feature CREATE TABLE CURRENT_STATS ( TIME_STAMP DATE NOT NULL, NODE_ID VARCHAR(40) NOT NULL, diff --git a/distribution/src/dbscripts/oracle/oracle_transaction_count.sql b/distribution/src/dbscripts/oracle/oracle_transaction_count.sql index aacef1ef4d..368af2bc52 100644 --- a/distribution/src/dbscripts/oracle/oracle_transaction_count.sql +++ b/distribution/src/dbscripts/oracle/oracle_transaction_count.sql @@ -1,3 +1,4 @@ +-- Related to the deprecated transaction count feature CREATE TABLE CURRENT_STATS ( TIME_STAMP DATE NOT NULL, NODE_ID VARCHAR(40) NOT NULL, diff --git a/distribution/src/dbscripts/postgres/postgresql_transaction_count.sql b/distribution/src/dbscripts/postgres/postgresql_transaction_count.sql index 903a8e2ebf..15cfad60ae 100644 --- a/distribution/src/dbscripts/postgres/postgresql_transaction_count.sql +++ b/distribution/src/dbscripts/postgres/postgresql_transaction_count.sql @@ -1,3 +1,4 @@ +-- Related to the deprecated transaction count feature CREATE TABLE IF NOT EXISTS CURRENT_STATS ( TIME_STAMP DATE NOT NULL, NODE_ID VARCHAR(40) NOT NULL, diff --git a/distribution/src/resources/config-tool/deployment-full.toml b/distribution/src/resources/config-tool/deployment-full.toml index 655fda4f26..1ffeb4ae46 100644 --- a/distribution/src/resources/config-tool/deployment-full.toml +++ b/distribution/src/resources/config-tool/deployment-full.toml @@ -1099,11 +1099,11 @@ user.password = "pwd-2" enable = false #################### Transaction Counter Handler ############################ -[transaction_counter] -enable = true -data_source = "WSO2_COORDINATION_DB" -update_interval = 2 - +# This implementation of transaction counter is deprecated +#[transaction_counter] +#enable = true +#data_source = "WSO2_COORDINATION_DB" +#update_interval = 2 #################### Service Catalog ####################################### [[service_catalog]] diff --git a/integration/mediation-tests/tests-platform/pom.xml b/integration/mediation-tests/tests-platform/pom.xml index e30198d2f3..cdef03580d 100644 --- a/integration/mediation-tests/tests-platform/pom.xml +++ b/integration/mediation-tests/tests-platform/pom.xml @@ -35,8 +35,11 @@ tests-rabbitmq tests-coordination tests-userstore - tests-transaction - + + + + +