public class AxonServerQueryBus extends Object implements org.axonframework.queryhandling.QueryBus
QueryBus implementation that connects to Axon Server to submit and receive queries and query responses.
Delegates incoming queries to the provided localSegment.| Constructor and Description |
|---|
AxonServerQueryBus(AxonServerConnectionManager axonServerConnectionManager,
AxonServerConfiguration configuration,
org.axonframework.queryhandling.QueryUpdateEmitter updateEmitter,
org.axonframework.queryhandling.QueryBus localSegment,
org.axonframework.serialization.Serializer messageSerializer,
org.axonframework.serialization.Serializer genericSerializer,
QueryPriorityCalculator priorityCalculator)
Creates an instance of the Axon Server
QueryBus client. |
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect() |
org.axonframework.queryhandling.QueryBus |
localSegment()
Returns the local segment configured for this instance.
|
void |
on(QueryProviderInbound.RequestCase requestCase,
Consumer<QueryProviderInbound> consumer) |
<Q,R> CompletableFuture<org.axonframework.queryhandling.QueryResponseMessage<R>> |
query(org.axonframework.queryhandling.QueryMessage<Q,R> queryMessage) |
org.axonframework.queryhandling.QueryUpdateEmitter |
queryUpdateEmitter() |
org.axonframework.common.Registration |
registerDispatchInterceptor(org.axonframework.messaging.MessageDispatchInterceptor<? super org.axonframework.queryhandling.QueryMessage<?,?>> dispatchInterceptor) |
org.axonframework.common.Registration |
registerHandlerInterceptor(org.axonframework.messaging.MessageHandlerInterceptor<? super org.axonframework.queryhandling.QueryMessage<?,?>> interceptor) |
<Q,R> Stream<org.axonframework.queryhandling.QueryResponseMessage<R>> |
scatterGather(org.axonframework.queryhandling.QueryMessage<Q,R> queryMessage,
long timeout,
TimeUnit timeUnit) |
<R> org.axonframework.common.Registration |
subscribe(String queryName,
Type responseType,
org.axonframework.messaging.MessageHandler<? super org.axonframework.queryhandling.QueryMessage<?,R>> handler) |
<Q,I,U> org.axonframework.queryhandling.SubscriptionQueryResult<org.axonframework.queryhandling.QueryResponseMessage<I>,org.axonframework.queryhandling.SubscriptionQueryUpdateMessage<U>> |
subscriptionQuery(org.axonframework.queryhandling.SubscriptionQueryMessage<Q,I,U> query,
org.axonframework.queryhandling.SubscriptionQueryBackpressure backPressure,
int updateBufferSize) |
public AxonServerQueryBus(AxonServerConnectionManager axonServerConnectionManager, AxonServerConfiguration configuration, org.axonframework.queryhandling.QueryUpdateEmitter updateEmitter, org.axonframework.queryhandling.QueryBus localSegment, org.axonframework.serialization.Serializer messageSerializer, org.axonframework.serialization.Serializer genericSerializer, QueryPriorityCalculator priorityCalculator)
QueryBus client. Will connect to an Axon Server instance to submit
and receive queries and query responses.axonServerConnectionManager - a AxonServerConnectionManager which creates the connection to an Axon
Server platformconfiguration - the AxonServerConfiguration containing specifics like the client and
component names used to identify the application in Axon Server among othersupdateEmitter - the QueryUpdateEmitter used to emits incremental updates to
subscription querieslocalSegment - a QueryBus handling the incoming queries for the local applicationmessageSerializer - a Serializer used to de-/serialize the payload and metadata of query
messages and responsesgenericSerializer - a Serializer used for communication of other objects than query
message and response, payload and metadatapriorityCalculator - a QueryPriorityCalculator calculating the request priority based on
the content, and adds this priority to the requestpublic <R> org.axonframework.common.Registration subscribe(String queryName, Type responseType, org.axonframework.messaging.MessageHandler<? super org.axonframework.queryhandling.QueryMessage<?,R>> handler)
subscribe in interface org.axonframework.queryhandling.QueryBuspublic <Q,R> CompletableFuture<org.axonframework.queryhandling.QueryResponseMessage<R>> query(org.axonframework.queryhandling.QueryMessage<Q,R> queryMessage)
query in interface org.axonframework.queryhandling.QueryBuspublic <Q,R> Stream<org.axonframework.queryhandling.QueryResponseMessage<R>> scatterGather(org.axonframework.queryhandling.QueryMessage<Q,R> queryMessage, long timeout, TimeUnit timeUnit)
scatterGather in interface org.axonframework.queryhandling.QueryBuspublic void disconnect()
public org.axonframework.queryhandling.QueryBus localSegment()
public void on(QueryProviderInbound.RequestCase requestCase, Consumer<QueryProviderInbound> consumer)
public <Q,I,U> org.axonframework.queryhandling.SubscriptionQueryResult<org.axonframework.queryhandling.QueryResponseMessage<I>,org.axonframework.queryhandling.SubscriptionQueryUpdateMessage<U>> subscriptionQuery(org.axonframework.queryhandling.SubscriptionQueryMessage<Q,I,U> query,
org.axonframework.queryhandling.SubscriptionQueryBackpressure backPressure,
int updateBufferSize)
subscriptionQuery in interface org.axonframework.queryhandling.QueryBuspublic org.axonframework.queryhandling.QueryUpdateEmitter queryUpdateEmitter()
queryUpdateEmitter in interface org.axonframework.queryhandling.QueryBuspublic org.axonframework.common.Registration registerHandlerInterceptor(org.axonframework.messaging.MessageHandlerInterceptor<? super org.axonframework.queryhandling.QueryMessage<?,?>> interceptor)
registerHandlerInterceptor in interface org.axonframework.messaging.MessageHandlerInterceptorSupport<org.axonframework.queryhandling.QueryMessage<?,?>>public org.axonframework.common.Registration registerDispatchInterceptor(org.axonframework.messaging.MessageDispatchInterceptor<? super org.axonframework.queryhandling.QueryMessage<?,?>> dispatchInterceptor)
registerDispatchInterceptor in interface org.axonframework.messaging.MessageDispatchInterceptorSupport<org.axonframework.queryhandling.QueryMessage<?,?>>Copyright © 2010–2019. All rights reserved.