Skip to content

Commit

Permalink
Fixing issue in update Synapse Artifact flow
Browse files Browse the repository at this point in the history
  • Loading branch information
HiranyaKavishani committed May 7, 2024
1 parent 7bdef4e commit 23d1543
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import org.apache.axis2.deployment.DeploymentException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.synapse.commons.jmx.JmxConfigurationConstants;
import org.apache.synapse.commons.util.MiscellaneousUtil;
import org.apache.synapse.config.SynapsePropertiesLoader;
import org.apache.synapse.transport.customlogsetter.CustomLogSetter;
import org.apache.synapse.commons.jmx.MBeanRegistrar;
import org.apache.synapse.config.xml.MultiXMLConfigurationBuilder;
Expand All @@ -42,6 +45,10 @@ public class EndpointDeployer extends AbstractSynapseArtifactDeployer {

private static Log log = LogFactory.getLog(EndpointDeployer.class);

private static final boolean jmxEnabled = Boolean.parseBoolean(
MiscellaneousUtil.getProperty(SynapsePropertiesLoader.loadSynapseProperties(),
JmxConfigurationConstants.PROP_ENDPOINT_VIEW_JMX_ENABLE, "true"));

@Override
public String deploySynapseArtifact(OMElement artifactConfig, String fileName,
Properties properties) {
Expand Down Expand Up @@ -126,7 +133,7 @@ public String updateSynapseArtifact(OMElement artifactConfig, String fileName,

waitForCompletion();
existingEp.destroy();
if (existingArtifactName.equals(ep.getName())) {
if (existingArtifactName.equals(ep.getName()) && jmxEnabled) {
// If the endpoint name was same as the old one, above method call (destroy)
// will unregister the endpoint MBean - So we should register it again.
MBeanRegistrar.getInstance().registerMBean(
Expand Down

0 comments on commit 23d1543

Please sign in to comment.