ISessionHandler Interface

public interface ISessionHandler

Defines the contract for registering the session message processing callback QueueClient#registerSessionHandler(ISessionHandler) or SubscriptionClient#registerSessionHandler(ISessionHandler) for QueueClient and SubscriptionClient.

Method Summary

Modifier and Type Method and Description
void notifyException(Throwable exception, ExceptionPhase phase)

Receiving the exceptions that passed by pump during message processing.

CompletableFuture<Void> OnCloseSessionAsync(IMessageSession session)

Called just before a session is closed by the session pump

CompletableFuture<Void> onMessageAsync(IMessageSession session, IMessage message)

The callback for message pump to pass received Messages.

Method Details

notifyException

public void notifyException(Throwable exception, ExceptionPhase phase)

Receiving the exceptions that passed by pump during message processing.

Parameters:

exception - Exception received in pump.
phase - Exception phase.

OnCloseSessionAsync

public CompletableFuture OnCloseSessionAsync(IMessageSession session)

Called just before a session is closed by the session pump

Parameters:

session - session being closed

Returns:

a future that executes the action

onMessageAsync

public CompletableFuture onMessageAsync(IMessageSession session, IMessage message)

The callback for message pump to pass received Messages.

Parameters:

session - The MessageSession of the message.
message - The received Message.

Returns:

CompletableFuture for the message handler.

Applies to