-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2244 from ozangunalp/message_composability
Message metadata propagation with ack and nack
- Loading branch information
Showing
76 changed files
with
3,594 additions
and
335 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
50 changes: 50 additions & 0 deletions
50
api/src/main/java/io/smallrye/reactive/messaging/IncomingInterceptor.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,50 @@ | ||
package io.smallrye.reactive.messaging; | ||
|
||
import jakarta.enterprise.inject.spi.Prioritized; | ||
|
||
import org.eclipse.microprofile.reactive.messaging.Message; | ||
|
||
import io.smallrye.common.annotation.Experimental; | ||
|
||
/** | ||
* Interceptor for incoming messages on connector channels. | ||
* <p> | ||
* To register an outgoing interceptor, expose a managed bean, implementing this interface, | ||
* and qualified with {@code @Identifier} with the targeted channel name. | ||
* <p> | ||
* Only one interceptor is allowed to be bound for interception per incoming channel. | ||
* When multiple interceptors are available, implementation should override the {@link #getPriority()} method. | ||
*/ | ||
@Experimental("Smallrye-only feature") | ||
public interface IncomingInterceptor extends Prioritized { | ||
|
||
@Override | ||
default int getPriority() { | ||
return -1; | ||
} | ||
|
||
/** | ||
* Called after message received | ||
* | ||
* @param message received message | ||
* @return the message to dispatch for consumer methods, possibly mutated | ||
*/ | ||
default Message<?> afterMessageReceive(Message<?> message) { | ||
return message; | ||
} | ||
|
||
/** | ||
* Called after message acknowledgment | ||
* | ||
* @param message acknowledged message | ||
*/ | ||
void onMessageAck(Message<?> message); | ||
|
||
/** | ||
* Called after message negative-acknowledgement | ||
* | ||
* @param message message to negative-acknowledge | ||
* @param failure failure | ||
*/ | ||
void onMessageNack(Message<?> message, Throwable failure); | ||
} |
Oops, something went wrong.