クラス ZeroMqMessageProducer
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.zeromq.inbound.ZeroMqMessageProducer
- 実装済みのインターフェース一覧:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, SmartInitializingSingleton, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, MessageProducer, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent
@ManagedResource
@IntegrationManagedResource
public class ZeroMqMessageProducer
extends MessageProducerSupport
ZeroMq ソケットからのメッセージを消費するための
MessageProducerSupport 実装。SocketType.PAIR、SocketType.SUB、SocketType.PULL のみがサポートされています。このコンポーネントは、ソケットをバインドまたは接続できます。SocketType.SUB を使用すると、受信したトピックが ZeroMqHeaders.TOPIC に保存されます。
- 導入:
- 5.4
- 作成者:
- Artem Bilan, Alessio Matricardi
ネストされたクラスの概要
インターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
フィールドクラス AbstractEndpoint から継承されたフィールド
lifecycleLockクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクター概要
コンストラクターコンストラクター説明ZeroMqMessageProducer(org.zeromq.ZContext context) ZeroMqMessageProducer(org.zeromq.ZContext context, org.zeromq.SocketType socketType) 方法の概要
修飾子と型メソッド説明voiddestroy()protected voiddoStart()デフォルトでは何もしません。protected voiddoStop()デフォルトでは何もしません。intこのメッセージプロデューサーがまだ開始されていないか、ソケットが接続されている場合は、ソケットがバインドされているポートを返します。バインドされていません。protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。voidsetBindPort(int port) ZMQ.Socket.bind(String)を介した TCP プロトコルバインディング用のポートを構成します。voidsetConnectUrl(@Nullable StringSE connectUrl) ZMQ.Socket.connect(String)の URL を設定します。voidsetConsumeDelay(DurationSE consumeDelay) データが受信されないときに消費を遅らせるには、DurationSE を指定します。voidsetMessageConverter(MessageConverter messageConverter) 消費されたデータを生成メッセージに変換するためのMessageConverter(messageMapperの代替として) を提供します。voidsetMessageMapper(InboundMessageMapper<byte[]> messageMapper) 消費されたデータを生成メッセージに変換するためのInboundMessageMapperを提供します。voidsetReceiveRaw(boolean receiveRaw) voidsetSocketConfigurer(ConsumerSE<org.zeromq.ZMQ.Socket> socketConfigurer) ConsumerSE を提供して、セキュリティなどの任意のオプションでソケットを構成します。voidSocketType.SUBソケットがサブスクリプションに使用するトピックを指定します。voidsubscribeToTopics(StringSE... topics) voidunsubscribeFromTopics(StringSE... topics) voidunwrapTopic(boolean unwrapTopic) SocketType.SUBソケットが受信するトピックが追加の空フレームでラップされるかどうかを指定します。クラス MessageProducerSupport から継承されたメソッド
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, getOutputChannelName, getRequiredOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisherクラス AbstractEndpoint から継承されたメソッド
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopクラス IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringクラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース IntegrationManagement から継承されたメソッド
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedTypeインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentNameインターフェース SmartLifecycle から継承されたメソッド
isPauseable
フィールドの詳細
DEFAULT_CONSUME_DELAY
コンストラクターの詳細
ZeroMqMessageProducer
public ZeroMqMessageProducer(org.zeromq.ZContext context) ZeroMqMessageProducer
public ZeroMqMessageProducer(org.zeromq.ZContext context, org.zeromq.SocketType socketType)
方法の詳細
setConsumeDelay
データが受信されないときに消費を遅らせるには、DurationSE を指定します。- パラメーター:
consumeDelay- 空のときに消費を遅らせるDurationSE。デフォルトはDEFAULT_CONSUME_DELAYです。
setMessageMapper
- パラメーター:
messageMapper- 使用するInboundMessageMapper。
setMessageConverter
消費したデータを生成メッセージに変換するためのMessageConverter(messageMapperの代替として)を指定します。setReceiveRaw(boolean)がtrueの場合は無視されます。- パラメーター:
messageConverter- 使用するMessageConverter。
setReceiveRaw
public void setReceiveRaw(boolean receiveRaw) - パラメーター:
receiveRaw-ZMsgから変換するかどうか。デフォルトで変換します。
setSocketConfigurer
ConsumerSE を提供して、セキュリティなどの任意のオプションでソケットを構成します。- パラメーター:
socketConfigurer- ソケットオプションのコンフィギュレーター。
setTopics
SocketType.SUBソケットがサブスクリプションに使用するトピックを指定します。サポートされている他のすべてのSocketTypeでは無視されます。- パラメーター:
topics- 使用するトピック。
setConnectUrl
ZMQ.Socket.connect(String)の URL を設定します。setBindPort(int)とは排他的です。- パラメーター:
connectUrl- ZeroMq ソケットを接続する URL。
setBindPort
public void setBindPort(int port) ZMQ.Socket.bind(String)を介した TCP プロトコルバインディング用のポートを構成します。setConnectUrl(String)と相互に排他的です。- パラメーター:
port- ZeroMq ソケットを TCP 経由でバインドするポート。
getBoundPort
public int getBoundPort()このメッセージプロデューサーがまだ開始されていないか、ソケットが接続されている場合は、ソケットがバインドされているポートを返します。バインドされていません。- 戻り値:
- ソケットまたは 0 のポート。
unwrapTopic
public void unwrapTopic(boolean unwrapTopic) SocketType.SUBソケットが受信するトピックが追加の空フレームでラップされるかどうかを指定します。サポートされている他のすべてのSocketTypeでは無視されます。この属性はデフォルトでtrueに設定されています。- パラメーター:
unwrapTopic- 受信したトピックが追加の空のフレームでラップされている場合は true です。- 導入:
- 6.2.6
getComponentType
- 次で指定:
- インターフェース
NamedComponent内のgetComponentType - オーバーライド:
- クラス
MessageProducerSupportのgetComponentType
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
MessageProducerSupportのonInit
subscribeToTopics
unsubscribeFromTopics
doStart
protected void doStart()クラスからコピーされた説明:MessageProducerSupportデフォルトでは何も実行されません。ライフサイクル管理された動作が必要な場合、サブクラスはこれをオーバーライドできます。'lifecycleLock' によって保護されています。- オーバーライド:
- クラス
MessageProducerSupportのdoStart
doStop
protected void doStop()クラスからコピーされた説明:MessageProducerSupportデフォルトでは何もしません。サブクラスは、ライフサイクル管理の動作が必要な場合、これをオーバーライドできます。- オーバーライド:
- クラス
MessageProducerSupportのdoStop
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBean内のdestroy - 次で指定:
- インターフェース
IntegrationManagement内のdestroy - オーバーライド:
- クラス
AbstractEndpointのdestroy