-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8534a7
commit 65840ea
Showing
12 changed files
with
269 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...mule/opentelemetry/internal/notifications/listeners/AsyncMessageNotificationListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.avioconsulting.mule.opentelemetry.internal.notifications.listeners; | ||
|
||
import com.avioconsulting.mule.opentelemetry.internal.processor.MuleNotificationProcessor; | ||
import org.mule.runtime.api.notification.AsyncMessageNotification; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Async work is scheduled and completed beyond the lifecycle of `mule:async` | ||
* processor execution. | ||
* This dedicated listener for AsyncMessageNotification will let us process the | ||
* spans for Aynch chain of processors. | ||
* | ||
* @since 2.1.2 | ||
*/ | ||
public class AsyncMessageNotificationListener extends AbstractMuleNotificationListener | ||
implements org.mule.runtime.api.notification.AsyncMessageNotificationListener<AsyncMessageNotification> { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncMessageNotificationListener.class); | ||
|
||
public AsyncMessageNotificationListener(MuleNotificationProcessor muleNotificationProcessor) { | ||
super(muleNotificationProcessor); | ||
} | ||
|
||
@Override | ||
public void onNotification(AsyncMessageNotification notification) { | ||
LOGGER.trace("===> Received {}:{}", notification.getClass().getName(), notification.getActionName()); | ||
switch (Integer.parseInt(notification.getAction().getIdentifier())) { | ||
case AsyncMessageNotification.PROCESS_ASYNC_SCHEDULED: | ||
LOGGER.trace("Scheduled {}:{} - {}", notification.getEventName(), | ||
notification.getComponent().getIdentifier().getName(), | ||
notification.getEvent().getContext().getId()); | ||
muleNotificationProcessor.handleAsyncScheduledEvent(notification); | ||
break; | ||
case AsyncMessageNotification.PROCESS_ASYNC_COMPLETE: | ||
LOGGER.trace("Completed {} - {}", notification.getEventName(), | ||
notification.getEvent().getContext().getId()); | ||
muleNotificationProcessor.handleProcessorEndEvent(notification); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.