Skip to content

Commit

Permalink
W-12041210-revert-commits (#608)
Browse files Browse the repository at this point in the history
* Revert "Added test"

This reverts commit b588369.

* Revert "Fix"

This reverts commit b46317b.

* Revert "Removing unnecessary if condition"

This reverts commit ad21c43.

* Revert "W-12041210: Provide a way to set the status of a current span and span Kind from a connector (needed in sdk api)"

This reverts commit c90bce8.

* Revert "Review"

This reverts commit a78f35e.

* Revert "Refactor"

This reverts commit 3fcf667.

* Revert "Refactor and tests"

This reverts commit 93b3aaa.

* Revert "W-11859222: A.8.2 Respect semantic conventions of span generation in JMS"

This reverts commit c3976a1.
  • Loading branch information
juanfloresMule authored Aug 22, 2024
1 parent a63338a commit 51df1dc
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 366 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import static org.mule.extensions.jms.internal.common.JmsCommons.EXAMPLE_CONTENT_TYPE;
import static org.mule.extensions.jms.internal.common.JmsCommons.EXAMPLE_ENCODING;
import static org.mule.extensions.jms.internal.operation.profiling.tracing.JmsConsumeSpanCustomizer.getJmsConsumeSpanCustomizer;

import static org.slf4j.LoggerFactory.getLogger;

import org.mule.extensions.jms.api.config.ConsumerAckMode;
Expand All @@ -22,6 +20,7 @@
import org.mule.extensions.jms.internal.connection.session.JmsSessionManager;
import org.mule.extensions.jms.internal.metadata.JmsOutputResolver;
import org.mule.jms.commons.api.AttributesOutputResolver;
import org.mule.jms.commons.api.message.JmsAttributes;
import org.mule.jms.commons.internal.connection.JmsTransactionalConnection;
import org.mule.runtime.api.connection.ConnectionException;
import org.mule.runtime.api.lifecycle.Disposable;
Expand All @@ -36,14 +35,14 @@
import org.mule.runtime.extension.api.annotation.param.display.Example;
import org.mule.runtime.extension.api.annotation.param.display.Summary;
import org.mule.runtime.extension.api.runtime.operation.Result;
import org.mule.runtime.extension.api.runtime.parameter.CorrelationInfo;
import org.mule.runtime.extension.api.runtime.process.CompletionCallback;
import org.mule.runtime.extension.api.tx.OperationTransactionalAction;
import org.mule.sdk.compatibility.api.utils.ForwardCompatibilityHelper;

import java.util.concurrent.TimeUnit;

import javax.inject.Inject;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;

Expand All @@ -66,9 +65,6 @@ public final class JmsConsume implements Initialisable, Disposable {

private org.mule.jms.commons.internal.operation.JmsConsume jmsConsume;

@Inject
private java.util.Optional<ForwardCompatibilityHelper> forwardCompatibilityHelper;

/**
* Operation that allows the user to consume a single {@link Message} from a given {@link Destination}.
*
Expand All @@ -81,8 +77,8 @@ public final class JmsConsume implements Initialisable, Disposable {
* @param selector a custom JMS selector for filtering the messages
* @param contentType the {@link Message}'s content content type
* @param encoding the {@link Message}'s content encoding
* @param maximumWait maximum time to wait for a message before timing out
* @param maximumWaitUnit Time unit to be used in the maximumWaitTime configurations
* @param maximumWait maximum time to wait for a message before timing out
* @param maximumWaitUnit Time unit to be used in the maximumWaitTime configurations
* @return a {@link Result} with the {@link Message} content as {@link Result#getOutput} and its properties
* and headers as {@link Result#getAttributes}
* @throws JmsConsumeException if an error occurs
Expand All @@ -101,10 +97,8 @@ public Result<Object, Object> consume(@Config JmsConfig config,
defaultValue = "10000") @Summary("Maximum time to wait for a message to arrive before timeout") Long maximumWait,
@Optional(
defaultValue = "MILLISECONDS") @Example("MILLISECONDS") @Summary("Time unit to be used in the maximumWaitTime configuration") TimeUnit maximumWaitUnit,
OperationTransactionalAction transactionalAction,
CorrelationInfo correlationInfo)
OperationTransactionalAction transactionalAction)
throws JmsExtensionException, ConnectionException {
customizeCurrentSpan(connection, destination, consumerType, correlationInfo);
return (Result) jmsConsume.consume(config, connection, destination, consumerType, ackMode,
selector, contentType, encoding, maximumWait,
maximumWaitUnit, transactionalAction);
Expand All @@ -113,20 +107,11 @@ public Result<Object, Object> consume(@Config JmsConfig config,

@Override
public void initialise() {
jmsConsume =
new org.mule.jms.commons.internal.operation.JmsConsume(sessionManager, schedulerService);
jmsConsume = new org.mule.jms.commons.internal.operation.JmsConsume(sessionManager, schedulerService);
}

@Override
public void dispose() {
jmsConsume.dispose();
}

private void customizeCurrentSpan(JmsTransactionalConnection connection, String destination,
org.mule.jms.commons.api.destination.ConsumerType consumerType,
org.mule.runtime.extension.api.runtime.parameter.CorrelationInfo correlationInfo) {
forwardCompatibilityHelper
.ifPresent(fch -> getJmsConsumeSpanCustomizer().customizeSpan(fch.getDistributedTraceContextManager(correlationInfo),
connection, destination, consumerType));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
package org.mule.extensions.jms.internal.operation;

import static org.mule.extensions.jms.internal.common.JmsCommons.QUEUE;
import static org.mule.extensions.jms.internal.operation.profiling.tracing.JmsPublishSpanCustomizer.getJmsPublishSpanCustomizer;

import static org.slf4j.LoggerFactory.getLogger;

import org.mule.extensions.jms.api.config.JmsProducerConfig;
Expand All @@ -35,7 +33,6 @@
import org.mule.runtime.extension.api.runtime.parameter.OutboundCorrelationStrategy;
import org.mule.runtime.extension.api.runtime.process.CompletionCallback;
import org.mule.runtime.extension.api.tx.OperationTransactionalAction;
import org.mule.sdk.compatibility.api.utils.ForwardCompatibilityHelper;

import javax.inject.Inject;
import javax.jms.Destination;
Expand All @@ -58,9 +55,6 @@ public final class JmsPublish implements Initialisable, Disposable {
@Inject
private SchedulerService schedulerService;

@Inject
private java.util.Optional<ForwardCompatibilityHelper> forwardCompatibilityHelper;

private org.mule.jms.commons.internal.operation.JmsPublish jmsPublish;

/**
Expand Down Expand Up @@ -91,18 +85,10 @@ public void publish(@Config JmsConfig config, @Connection JmsTransactionalConnec
CompletionCallback<Void, Void> completionCallback)

throws JmsExtensionException {
customizeCurrentSpan(connection, destination, destinationType, correlationInfo);
jmsPublish.publish(config, connection, destination, destinationType, messageBuilder, overrides, transactionalAction,
sendCorrelationId, correlationInfo, completionCallback);
}

private void customizeCurrentSpan(JmsTransactionalConnection connection, String destination, DestinationType destinationType,
CorrelationInfo correlationInfo) {
forwardCompatibilityHelper
.ifPresent(fch -> getJmsPublishSpanCustomizer().customizeSpan(fch.getDistributedTraceContextManager(correlationInfo),
connection, destination, destinationType));
}


@Override
public void dispose() {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ interface JmsStory {
String MESSAGE_TYPES = "Durable Subscriber";

String MESSAGE_FILTERING = "Message Filtering";

String TRACING = "Tracing";
}

}
Expand Down
Loading

0 comments on commit 51df1dc

Please sign in to comment.