Class PubSubMessageSource
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<T>
org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<Object>
com.google.cloud.spring.pubsub.integration.inbound.PubSubMessageSource
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.integration.core.MessageSource<Object>,org.springframework.integration.IntegrationPattern,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.IntegrationInboundManagement,org.springframework.integration.support.management.IntegrationManagement,org.springframework.integration.support.management.MessageSourceManagement
public class PubSubMessageSource
extends org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<Object>
A PubSub
Synchronous pull implementation of
AbstractMessageSource.- Since:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME -
Constructor Summary
ConstructorsConstructorDescriptionPubSubMessageSource(PubSubSubscriberOperations pubSubSubscriberOperations, String subscriptionName) Instantiates a Pub/Sub inbound message adapter to poll a given subscription for messages. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectdoReceive(int fetchSize) Provides a single polled message.voidsetAckMode(AckMode ackMode) voidsetBlockOnPull(boolean blockOnPull) Instructs synchronous pull to wait until at least one message is available.voidsetHeaderMapper(org.springframework.integration.mapping.HeaderMapper<Map<String, String>> headerMapper) voidsetPayloadType(Class<?> payloadType) Methods inherited from class org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource
doReceive, getMaxFetchSize, setMaxFetchSizeMethods inherited from class org.springframework.integration.endpoint.AbstractMessageSource
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setBeanFactory, setConversionServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs, isObserved, registerObservationRegistryMethods inherited from interface org.springframework.integration.core.MessageSource
getIntegrationPatternType
-
Constructor Details
-
PubSubMessageSource
public PubSubMessageSource(PubSubSubscriberOperations pubSubSubscriberOperations, String subscriptionName) Instantiates a Pub/Sub inbound message adapter to poll a given subscription for messages.- Parameters:
pubSubSubscriberOperations-PubSubSubscriberOperationsto usesubscriptionName- short or fully qualified subscription name
-
-
Method Details
-
setAckMode
-
setPayloadType
-
setHeaderMapper
-
setBlockOnPull
public void setBlockOnPull(boolean blockOnPull) Instructs synchronous pull to wait until at least one message is available.- Parameters:
blockOnPull- whether to block until a message is available
-
doReceive
Provides a single polled message.Messages are received from Pub/Sub by synchronous pull, in batches determined by
fetchSize.- Specified by:
doReceivein classorg.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<Object>- Parameters:
fetchSize- number of messages to fetch from Pub/Sub.- Returns:
Messagewrapper containing the original message.
-
getComponentType
-