public interface MessagingAccessPoint extends ServiceLifecycle
MessagingAccessPoint may be obtained from OMS, which is capable of creating Producer, Consumer, ResourceManager, and other facility entities.
For example:
MessagingAccessPoint messagingAccessPoint = OMS.getMessagingAccessPoint("oms:rocketmq://alice@rocketmq.apache.org/us-east:default_space");
messagingAccessPoint.startup();
Producer producer = messagingAccessPoint.createProducer();
producer.startup();
producer.send(producer.createBytesMessage("HELLO_QUEUE", "HELLO_BODY".getBytes(Charset.forName("UTF-8"))));
| Modifier and Type | Method and Description |
|---|---|
KeyValue |
attributes()
Returns the attributes of this
MessagingAccessPoint instance. |
Producer |
createProducer()
Creates a new
Producer for the specified MessagingAccessPoint. |
Producer |
createProducer(KeyValue attributes)
Creates a new
Producer for the specified MessagingAccessPoint
with some preset attributes. |
PullConsumer |
createPullConsumer()
Creates a new
PullConsumer for the specified MessagingAccessPoint. |
PullConsumer |
createPullConsumer(KeyValue attributes)
Creates a new
PullConsumer for the specified MessagingAccessPoint with some preset attributes. |
PushConsumer |
createPushConsumer()
Creates a new
PushConsumer for the specified MessagingAccessPoint. |
PushConsumer |
createPushConsumer(KeyValue attributes)
Creates a new
PushConsumer for the specified MessagingAccessPoint with some preset attributes. |
StreamingConsumer |
createStreamingConsumer()
Creates a new
StreamingConsumer for the specified MessagingAccessPoint. |
StreamingConsumer |
createStreamingConsumer(KeyValue attributes)
Creates a new
StreamingConsumer for the specified MessagingAccessPoint with some preset
attributes. |
String |
implVersion()
Returns the target OMS specification version of the specified vendor implementation.
|
ResourceManager |
resourceManager()
Gets a lightweight
ResourceManager instance from the specified MessagingAccessPoint. |
shutdown, startupString implVersion()
OMS.specVersionKeyValue attributes()
MessagingAccessPoint instance.
There are some standard attributes defined by OMS for MessagingAccessPoint:
OMSBuiltinKeys.ACCESS_POINTS, the specified access points.
OMSBuiltinKeys.DRIVER_IMPL, the fully qualified class name of the specified MessagingAccessPoint's
implementation, the default value is io.openmessaging.<driver_type>.MessagingAccessPointImpl.
OMSBuiltinKeys.REGION, the region the resources reside in.
OMSBuiltinKeys.ACCOUNT_ID, the ID of the specific account system that owns the resource.
Producer createProducer()
Producer for the specified MessagingAccessPoint.ProducerOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorProducer createProducer(KeyValue attributes)
Producer for the specified MessagingAccessPoint
with some preset attributes.attributes - the preset attributesProducerOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorPushConsumer createPushConsumer()
PushConsumer for the specified MessagingAccessPoint.
The returned PushConsumer isn't attached to any queue,
uses PushConsumer.attachQueue(String, MessageListener) to attach queues.PushConsumerOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorPushConsumer createPushConsumer(KeyValue attributes)
PushConsumer for the specified MessagingAccessPoint with some preset attributes.attributes - the preset attributesPushConsumerOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorPullConsumer createPullConsumer()
PullConsumer for the specified MessagingAccessPoint.PullConsumerOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorPullConsumer createPullConsumer(KeyValue attributes)
PullConsumer for the specified MessagingAccessPoint with some preset attributes.attributes - the preset attributesPullConsumerOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorStreamingConsumer createStreamingConsumer()
StreamingConsumer for the specified MessagingAccessPoint.StreamOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorStreamingConsumer createStreamingConsumer(KeyValue attributes)
StreamingConsumer for the specified MessagingAccessPoint with some preset
attributes.attributes - the preset attributesOMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorResourceManager resourceManager()
ResourceManager instance from the specified MessagingAccessPoint.OMSRuntimeException - if the MessagingAccessPoint fails to handle this request
due to some internal errorCopyright © 2017–2018 OpenMessaging. All rights reserved.