diff --git a/.github/workflows/transaction-tests.yml b/.github/workflows/transaction-tests.yml deleted file mode 100644 index 82c330bee5..0000000000 --- a/.github/workflows/transaction-tests.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Transaction Counter tests (OpenJDK11 & MySQL) - -on: [push, pull_request] - -jobs: - ubuntu: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up MySQL - run: | - sudo /etc/init.d/mysql start - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - distribution: 'adopt' - java-version: 11 - - name: Build in JDK 11 - run: mvn -B clean install -DskipTests --file pom.xml - - name: Transaction Counter Tests - run: mvn -B clean install --file integration/pom.xml -P transaction-tests 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..78a6ee2a5c 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,7 @@ 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())); + 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.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/RequestCountResource.java b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/RequestCountResource.java index ed8c5471cc..a104960792 100644 --- a/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/RequestCountResource.java +++ b/components/org.wso2.micro.integrator.extensions/org.wso2.micro.integrator.management.apis/src/main/java/org/wso2/micro/integrator/management/apis/RequestCountResource.java @@ -50,6 +50,9 @@ /** + * This feature is deprecated and will be removed in a future release. + * @deprecated + * * Resource for a retrieving aggregated transaction count. *

* Handles resources in the form "management/transactions/{param}" 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..644de0b5f2 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,10 +106,6 @@ public class ServiceBusInitializer { private DataSourceService dataSourceService; - private TransactionCountHandlerComponent transactionCountHandlerComponent; - - private ExecutorService transactionCountExecutor; - @Activate protected void activate(ComponentContext ctxt) { @@ -198,14 +189,6 @@ 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)); - } if (log.isDebugEnabled()) { log.debug("SynapseEnvironmentService Registered"); } @@ -260,12 +243,6 @@ private String getMainSequenceName(String cappName) { @Deactivate protected void deactivate(ComponentContext ctxt) { - 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/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/DataHolder.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/DataHolder.java index 0aae95fef9..8b5180977c 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/DataHolder.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/DataHolder.java @@ -21,7 +21,9 @@ import org.wso2.micro.integrator.initializer.handler.transaction.store.TransactionStore; /** - * DataHolder class for transaction count component. + * This feature is deprecated and will be removed in a future release. + * + * @deprecated */ public class DataHolder { diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionConstants.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionConstants.java index 55f6b20a41..34171f9679 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionConstants.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionConstants.java @@ -22,6 +22,10 @@ import java.io.File; +/** + * This feature is deprecated and will be removed in a future release. + * @deprecated + */ public class TransactionConstants { public static final String PUBLIC_KEY = System.getProperty(ServerConstants.CARBON_HOME) + File.separator diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandler.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandler.java index 0612458fda..14ec63862f 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandler.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandler.java @@ -30,6 +30,10 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.RejectedExecutionException; +/** + * This feature is deprecated and will be removed in a future release. + * @deprecated + */ public class TransactionCountHandler extends AbstractSynapseHandler { private static final Log LOG = LogFactory.getLog(TransactionCountHandler.class); diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandlerComponent.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandlerComponent.java index f92def6cc8..977e99c5e4 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandlerComponent.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/TransactionCountHandlerComponent.java @@ -39,7 +39,8 @@ import javax.sql.DataSource; /** - * This class represents the internal transaction count handler component. + * This feature is deprecated and will be removed in a future release. + * @deprecated */ public class TransactionCountHandlerComponent { diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterException.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterException.java index 04b417ec13..349e9bd553 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterException.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterException.java @@ -18,6 +18,10 @@ package org.wso2.micro.integrator.initializer.handler.transaction.exception; +/** + * This feature is deprecated and will be removed in a future release. + * @deprecated + */ public class TransactionCounterException extends Exception { public TransactionCounterException(String msg, Exception e) { diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterInitializationException.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterInitializationException.java index b1ffc5be03..8617c685b4 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterInitializationException.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/exception/TransactionCounterInitializationException.java @@ -18,6 +18,10 @@ package org.wso2.micro.integrator.initializer.handler.transaction.exception; +/** + * This feature is deprecated and will be removed in a future release. + * @deprecated + */ public class TransactionCounterInitializationException extends Exception { public TransactionCounterInitializationException(String msg) { diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/security/CryptoUtil.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/security/CryptoUtil.java index 499ea311e4..ffa5da6b69 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/security/CryptoUtil.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/security/CryptoUtil.java @@ -42,6 +42,9 @@ import javax.xml.bind.DatatypeConverter; /** + * This feature is deprecated and will be removed in a future release. + * @deprecated + * * This class will provide the required methods to encrypt a given value. */ public class CryptoUtil { diff --git a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/store/TransactionStore.java b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/store/TransactionStore.java index ea561552f5..0720965495 100644 --- a/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/store/TransactionStore.java +++ b/components/org.wso2.micro.integrator.initializer/src/main/java/org/wso2/micro/integrator/initializer/handler/transaction/store/TransactionStore.java @@ -28,6 +28,9 @@ import javax.sql.DataSource; /** + * This feature is deprecated and will be removed in a future release. + * @deprecated + * * The layer which connects to the transaction data. */ public class TransactionStore { diff --git a/distribution/src/dbscripts/db2/db2_transaction_count.sql b/distribution/src/dbscripts/db2/db2_transaction_count.sql index 903a8e2ebf..f0d763ef44 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 counter 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..d244c4057f 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 counter 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..8662490e90 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 counter 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..cfa8dbdb50 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 counter 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..cfa8dbdb50 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 counter 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..f0d763ef44 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 counter 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..7ecc1a91f5 100644 --- a/distribution/src/resources/config-tool/deployment-full.toml +++ b/distribution/src/resources/config-tool/deployment-full.toml @@ -1098,13 +1098,6 @@ user.password = "pwd-2" [internal_apis.file_user_store] enable = false -#################### Transaction Counter Handler ############################ -[transaction_counter] -enable = true -data_source = "WSO2_COORDINATION_DB" -update_interval = 2 - - #################### Service Catalog ####################################### [[service_catalog]] apim_host = "https://127.0.0.1:9443" diff --git a/integration/mediation-tests/tests-platform/pom.xml b/integration/mediation-tests/tests-platform/pom.xml index e30198d2f3..896ac75ce3 100644 --- a/integration/mediation-tests/tests-platform/pom.xml +++ b/integration/mediation-tests/tests-platform/pom.xml @@ -35,8 +35,8 @@ tests-rabbitmq tests-coordination tests-userstore - tests-transaction - + +