Skip to content

Commit

Permalink
Merge pull request #1620 from eclipse-ditto/bugfix/1619-metrics-outbo…
Browse files Browse the repository at this point in the history
…und-category

#1619 adjusted monitor to use in OutboundMappingProcessorActor
  • Loading branch information
thjaeckle authored Apr 26, 2023
2 parents a5862aa + b4060fe commit 20f2316
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,21 @@ protected OutboundSignalWithSender mapMessage(final OutboundSignal message) {
}

@Override
protected void messageDiscarded(OutboundSignal message, QueueOfferResult result) {
protected void messageDiscarded(final OutboundSignal message, final QueueOfferResult result) {
final Set<ConnectionMonitor> monitorsForOutboundSignal =
getMonitorsForOutboundSignal(message, MAPPED, LogType.MAPPED, responseMappedMonitor);
if (QueueOfferResult.dropped().equals(result)) {
responseDispatchedMonitor.failure(message.getSource(), "Message is dropped as a result of backpressure strategy!");
monitorsForOutboundSignal.forEach(monitor ->
monitor.failure(message.getSource(), "Message is dropped as a result of backpressure strategy!")
);
} else if (result instanceof final QueueOfferResult.Failure failure) {
responseDispatchedMonitor.failure(message.getSource(), "Enqueue failed! - failure: {}", failure.cause());
monitorsForOutboundSignal.forEach(monitor ->
monitor.failure(message.getSource(), "Enqueue failed! - failure: {}", failure.cause())
);
} else {
responseDispatchedMonitor.failure(message.getSource(), "Enqueue failed without acknowledgement!");
monitorsForOutboundSignal.forEach(monitor ->
monitor.failure(message.getSource(), "Enqueue failed without acknowledgement!")
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
import akka.testkit.TestProbe;
import akka.testkit.javadsl.TestKit;

@FixMethodOrder(MethodSorters.DEFAULT)
/**
* Tests in addition to {@link MessageMappingProcessorActorTest}
* for {@link OutboundMappingProcessorActor} only.
*/
@FixMethodOrder(MethodSorters.DEFAULT)
public final class OutboundMappingProcessorActorTest {

@ClassRule
Expand Down

0 comments on commit 20f2316

Please sign in to comment.