Repository navigation
Expand file tree
/
Copy pathPsrConsumer.php
More file actions
53 lines (47 loc) · 1.45 KB
/
Copy pathPsrConsumer.php
File metadata and controls
53 lines (47 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Enqueue\Psr;
/**
* A client uses a MessageConsumer object to receive messages from a destination.
* A MessageConsumer object is created by passing a Destination object
* to a message-consumer creation method supplied by a session.
*
* @see https://docs.oracle.com/javaee/7/api/javax/jms/MessageConsumer.html
*/
interface PsrConsumer
{
/**
* Gets the Queue associated with this queue receiver.
*
* @return PsrQueue
*/
public function getQueue();
/**
* Receives the next message that arrives within the specified timeout interval.
* This call blocks until a message arrives, the timeout expires, or this message consumer is closed.
* A timeout of zero never expires, and the call blocks indefinitely.
*
* @param int $timeout the timeout value (in milliseconds)
*
* @return PsrMessage|null
*/
public function receive($timeout = 0);
/**
* Receives the next message if one is immediately available.
*
* @return PsrMessage|null
*/
public function receiveNoWait();
/**
* Tell the MQ broker that the message was processed successfully.
*
* @param PsrMessage $message
*/
public function acknowledge(PsrMessage $message);
/**
* Tell the MQ broker that the message was rejected.
*
* @param PsrMessage $message
* @param bool $requeue
*/
public function reject(PsrMessage $message, $requeue = false);
}