Class TestMessage
Test Message
Minimal message implementation for testing.
Property Summary
-
$body protected
stringMessage body
-
$headers protected
array<string, mixed>Message headers
-
$properties protected
array<string, mixed>Message properties
Method Summary
-
__construct() public
Constructor
-
getBody() public
Get body
-
getCorrelationId() public
Get correlation ID
-
getHeader() public
Get header
-
getHeaders() public
Get headers
-
getMessageId() public
Get message ID
-
getProperties() public
Get properties
-
getProperty() public
Get property
-
getReplyTo() public
Get reply to
-
getTimestamp() public
Get timestamp
-
isRedelivered() public
Get redelivered flag
-
setBody() public
Set body
-
setCorrelationId() public
Set correlation ID
-
setHeader() public
Set header
-
setHeaders() public
Set headers
-
setMessageId() public
Set message ID
-
setProperties() public
Set properties
-
setProperty() public
Set property
-
setRedelivered() public
Set redelivered flag
-
setReplyTo() public
Set reply to
-
setTimestamp() public
Set timestamp
Method Detail
__construct() ¶ public
__construct(string $body = '', array<string, mixed> $properties = [], array<string, mixed> $headers = [])
Constructor
Parameters
-
string$body optional Message body
-
array<string, mixed>$properties optional Properties
-
array<string, mixed>$headers optional Headers
getHeader() ¶ public
getHeader(string $name, mixed $default = null): mixed
Get header
Parameters
-
string$name Header name
-
mixed$default optional Default value
Returns
mixedgetMessageId() ¶ public
getMessageId(): string|null
Get message ID
When a message is sent, MessageId can be ignored.
Returns
string|nullgetProperties() ¶ public
getProperties(): array<string, mixed>
Get properties
Returns
array<string, mixed>getProperty() ¶ public
getProperty(string $name, mixed $default = null): mixed
Get property
Parameters
-
string$name Property name
-
mixed$default optional Default value
Returns
mixedsetCorrelationId() ¶ public
setCorrelationId(?string $correlationId = null): void
Set correlation ID
Parameters
-
?string$correlationId optional Correlation ID
Returns
voidsetHeader() ¶ public
setHeader(string $name, mixed $value): void
Set header
Parameters
-
string$name Header name
-
mixed$value Header value
Returns
voidsetHeaders() ¶ public
setHeaders(array $headers): void
Set headers
Parameters
-
array$headers Headers
Returns
voidsetMessageId() ¶ public
setMessageId(?string $messageId = null): void
Set message ID
Parameters
-
?string$messageId optional Message ID
Returns
voidsetProperties() ¶ public
setProperties(array $properties): void
Set properties
Parameters
-
array$properties Properties
Returns
voidsetProperty() ¶ public
setProperty(string $name, mixed $value): void
Set property
Parameters
-
string$name Property name
-
mixed$value Property value
Returns
voidsetRedelivered() ¶ public
setRedelivered(bool $redelivered): void
Set redelivered flag
Parameters
-
bool$redelivered Redelivered
Returns
voidsetReplyTo() ¶ public
setReplyTo(?string $replyTo = null): void
Set reply to
Parameters
-
?string$replyTo optional Reply to
Returns
voidsetTimestamp() ¶ public
setTimestamp(?int $timestamp = null): void
Set timestamp
Parameters
-
?int$timestamp optional Timestamp
Returns
void