Skip to content

Commit

Permalink
Disable existing transaction counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Isuru Wijesiri committed Nov 1, 2023
1 parent 06c15ef commit cbbb812
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,6 @@ public static Map<String, Object> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -111,10 +106,6 @@ public class ServiceBusInitializer {

private DataSourceService dataSourceService;

private TransactionCountHandlerComponent transactionCountHandlerComponent;

private ExecutorService transactionCountExecutor;

@Activate
protected void activate(ComponentContext ctxt) {

Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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<SynapseHandler> iterator = handlers.iterator();
while (iterator.hasNext()) {
Expand Down
1 change: 0 additions & 1 deletion integration/mediation-tests/tests-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<module>tests-rabbitmq</module>
<module>tests-coordination</module>
<module>tests-userstore</module>
<module>tests-transaction</module>
<!-- <module>tests-wso2mb</module>-->
<!--<module>tests-sap</module>-->
</modules>
Expand Down

0 comments on commit cbbb812

Please sign in to comment.