public interface IMessageQueue
extends org.pipservices.commons.run.IOpenable
Not all queues may implement all the methods.
Attempt to call non-supported method will result in NotImplemented exception.
To verify if specific method is supported consult with MessagingCapabilities.
MessageEnvelop,
MessagingCapabilities| Modifier and Type | Method and Description |
|---|---|
void |
abandon(MessageEnvelop message)
Returns message into the queue and makes it available for all subscribers to
receive it again.
|
void |
beginListen(String correlationId,
IMessageReceiver receiver)
Listens for incoming messages without blocking the current thread.
|
void |
complete(MessageEnvelop message)
Permanently removes a message from the queue.
|
void |
endListen(String correlationId)
Ends listening for incoming messages.
|
MessagingCapabilities |
getCapabilities()
Gets the queue capabilities
|
Long |
getMessageCount()
Gets the current number of messages in the queue to be delivered.
|
String |
getName()
Gets the queue name
|
void |
listen(String correlationId,
IMessageReceiver receiver)
Listens for incoming messages and blocks the current thread until queue is
closed.
|
void |
moveToDeadLetter(MessageEnvelop message)
Permanently removes a message from the queue and sends it to dead letter
queue.
|
MessageEnvelop |
peek(String correlationId)
Peeks a single incoming message from the queue without removing it.
|
List<MessageEnvelop> |
peekBatch(String correlationId,
int messageCount)
Peeks multiple incoming messages from the queue without removing them.
|
MessageEnvelop |
receive(String correlationId,
long waitTimeout)
Receives an incoming message and removes it from the queue.
|
void |
renewLock(MessageEnvelop message,
long lockTimeout)
Renews a lock on a message that makes it invisible from other receivers in
the queue.
|
void |
send(String correlationId,
MessageEnvelop envelop)
Sends a message into the queue.
|
void |
sendAsObject(String correlationId,
String messageType,
Object message)
Sends an object into the queue.
|
String getName()
MessagingCapabilities getCapabilities()
Long getMessageCount()
void send(String correlationId, MessageEnvelop envelop) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.envelop - a message envelop to be sent.org.pipservices.commons.errors.ApplicationException - when error occured.void sendAsObject(String correlationId, String messageType, Object message) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.messageType - a message typemessage - an object value to be sentorg.pipservices.commons.errors.ApplicationException - when error occured.send(String, MessageEnvelop)MessageEnvelop peek(String correlationId) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.org.pipservices.commons.errors.ApplicationException - when error occured.List<MessageEnvelop> peekBatch(String correlationId, int messageCount) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.messageCount - a maximum number of messages to peek.org.pipservices.commons.errors.ApplicationException - when error occured.MessageEnvelop receive(String correlationId, long waitTimeout) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.waitTimeout - a timeout in milliseconds to wait for a message to come.org.pipservices.commons.errors.ApplicationException - when error occured.void renewLock(MessageEnvelop message, long lockTimeout) throws org.pipservices.commons.errors.ApplicationException
message - a message to extend its lock.lockTimeout - a locking timeout in milliseconds.org.pipservices.commons.errors.ApplicationException - when error occured.void complete(MessageEnvelop message) throws org.pipservices.commons.errors.ApplicationException
message - a message to remove.org.pipservices.commons.errors.ApplicationException - when error occured.void abandon(MessageEnvelop message) throws org.pipservices.commons.errors.ApplicationException
message - a message to return.org.pipservices.commons.errors.ApplicationException - when error occured.void moveToDeadLetter(MessageEnvelop message) throws org.pipservices.commons.errors.ApplicationException
message - a message to be removed.org.pipservices.commons.errors.ApplicationException - when error occured.void listen(String correlationId, IMessageReceiver receiver) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.receiver - a receiver to receive incoming messages.org.pipservices.commons.errors.ApplicationException - when error occured.IMessageReceiver,
receive(String, long)void beginListen(String correlationId, IMessageReceiver receiver)
correlationId - (optional) transaction id to trace execution through
call chain.receiver - a receiver to receive incoming messages.listen(String, IMessageReceiver),
IMessageReceivervoid endListen(String correlationId) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.org.pipservices.commons.errors.ApplicationException - when error occured.Copyright © 2018. All rights reserved.