Class GraphQLBrokerMessageHandler
java.lang.Object
org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
org.activiti.cloud.services.notifications.graphql.ws.transport.GraphQLBrokerMessageHandler
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.messaging.MessageHandler
public class GraphQLBrokerMessageHandler
extends org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
loggerFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionGraphQLBrokerMessageHandler(org.springframework.messaging.SubscribableChannel inboundChannel, org.springframework.messaging.MessageChannel outboundChannel, org.springframework.messaging.SubscribableChannel brokerChannel, GraphQLSubscriptionExecutor graphQLSubscriptionExecutor) -
Method Summary
Modifier and TypeMethodDescriptionintlongorg.springframework.messaging.support.MessageHeaderInitializerReturn the configured header initializer.long[]The configured value for the heart-beat settings.org.springframework.scheduling.TaskSchedulerReturn the configured TaskScheduler.protected final voidhandleConnectionInitMessage(org.springframework.messaging.Message<GraphQLMessage> message) protected final voidhandleConnectionTerminate(org.springframework.messaging.Message<GraphQLMessage> message) protected voidhandleMessageInternal(org.springframework.messaging.Message<?> message) protected final voidhandleStartSubscription(org.springframework.messaging.Message<GraphQLMessage> message) protected final voidhandleStopSubscription(org.springframework.messaging.Message<GraphQLMessage> message) booleanWhether the message broker is currently available and able to process messages.voidon(org.springframework.messaging.simp.broker.BrokerAvailabilityEvent event) setBufferCount(int bufferCount) setBufferTimeSpanMs(long bufferTimeSpanMs) voidsetHeaderInitializer(org.springframework.messaging.support.MessageHeaderInitializer headerInitializer) Configure aMessageHeaderInitializerto apply to the headers of all messages sent to the client outbound channel.setHeartbeatValue(long[] heartbeat) Configure the value for the heart-beat settings.setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler) Configure theTaskSchedulerto use for providing heartbeat support.protected voidprotected voidMethods inherited from class org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
checkDestinationPrefix, getApplicationEventPublisher, getBrokerChannel, getClientInboundChannel, getClientOutboundChannel, getClientOutboundChannelForSession, getDestinationPrefixes, getPhase, handleMessage, isAutoStartup, isPreservePublishOrder, isRunning, publishBrokerAvailableEvent, publishBrokerUnavailableEvent, setApplicationEventPublisher, setAutoStartup, setPhase, setPreservePublishOrder, setUserDestinationPredicate, start, stop, stop
-
Field Details
-
BROKER_NOT_AVAILABLE
- See Also:
-
-
Constructor Details
-
GraphQLBrokerMessageHandler
public GraphQLBrokerMessageHandler(org.springframework.messaging.SubscribableChannel inboundChannel, org.springframework.messaging.MessageChannel outboundChannel, org.springframework.messaging.SubscribableChannel brokerChannel, GraphQLSubscriptionExecutor graphQLSubscriptionExecutor)
-
-
Method Details
-
getGraphQLsubscriptionRegistry
-
getBufferTimeSpanMs
public long getBufferTimeSpanMs() -
setBufferTimeSpanMs
-
getBufferCount
public int getBufferCount() -
setBufferCount
-
on
@EventListener public void on(org.springframework.messaging.simp.broker.BrokerAvailabilityEvent event) -
isBrokerAvailable
public boolean isBrokerAvailable()Whether the message broker is currently available and able to process messages.Note that this is in addition to the
AbstractBrokerMessageHandler.isRunning()flag, which indicates whether this message handler is running. In other words the message handler must first be running and then the#isBrokerAvailable()flag may still independently alternate between being on and off depending on the concrete sub-class implementation.Application components may implement
org.springframework.context.ApplicationListener<BrokerAvailabilityEvent>to receive notifications when broker becomes available and unavailable.- Overrides:
isBrokerAvailablein classorg.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
-
startInternal
protected void startInternal()- Overrides:
startInternalin classorg.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
-
stopInternal
protected void stopInternal()- Overrides:
stopInternalin classorg.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
-
handleMessageInternal
protected void handleMessageInternal(org.springframework.messaging.Message<?> message) - Specified by:
handleMessageInternalin classorg.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
-
handleConnectionInitMessage
@Timed protected final void handleConnectionInitMessage(org.springframework.messaging.Message<GraphQLMessage> message) -
handleStartSubscription
@Timed protected final void handleStartSubscription(org.springframework.messaging.Message<GraphQLMessage> message) -
handleStopSubscription
@Timed protected final void handleStopSubscription(org.springframework.messaging.Message<GraphQLMessage> message) -
handleConnectionTerminate
@Timed protected final void handleConnectionTerminate(org.springframework.messaging.Message<GraphQLMessage> message) -
setTaskScheduler
public GraphQLBrokerMessageHandler setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler) Configure theTaskSchedulerto use for providing heartbeat support. Setting this property also sets theheartbeatValueto "10000, 10000".By default this is not set.
-
getTaskScheduler
public org.springframework.scheduling.TaskScheduler getTaskScheduler()Return the configured TaskScheduler. -
setHeartbeatValue
Configure the value for the heart-beat settings. The first number represents how often the server will write or send a heartbeat. The second is how often the client should write. 0 means no heartbeats.By default this is set to "0, 0" unless the
taskSchedulerin which case the default becomes "10000,10000" (in milliseconds). -
getHeartbeatValue
public long[] getHeartbeatValue()The configured value for the heart-beat settings. -
setHeaderInitializer
public void setHeaderInitializer(org.springframework.messaging.support.MessageHeaderInitializer headerInitializer) Configure aMessageHeaderInitializerto apply to the headers of all messages sent to the client outbound channel.By default this property is not set.
-
getHeaderInitializer
public org.springframework.messaging.support.MessageHeaderInitializer getHeaderInitializer()Return the configured header initializer.
-