Skip to content

Commit

Permalink
feat(message): expose isSealed as public field
Browse files Browse the repository at this point in the history
  • Loading branch information
CheerlessCloud committed Sep 24, 2018
1 parent 5b90b53 commit 32729ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/AMQPMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IMessage {
+id: ?string;
+correlationId: ?string;
+payload: Object;
+isSealed: boolean;
+headers: Map<string, mixed>;
+isAnswerQueueEnabled: boolean;
+_props: MessageProps;
Expand All @@ -27,9 +28,10 @@ export default class AMQPMessage implements IMessage {
_amqpMessage: CommonAMQPMessage;
_isSealed: boolean = false;

constructor(amqpMessage: CommonAMQPMessage, channel: AMQPChannel): IMessage {
constructor(amqpMessage: CommonAMQPMessage, channel: AMQPChannel, isSealed: ?boolean): IMessage {
this._channel = channel;
this._amqpMessage = amqpMessage;
this._isSealed = isSealed || false;
return this;
}

Expand All @@ -45,6 +47,10 @@ export default class AMQPMessage implements IMessage {
return this.getPayloadAsObject();
}

get isSealed(): boolean {
return this._isSealed;
}

get _props(): MessageProps {
return { ...this._amqpMessage.properties, ...this._amqpMessage.fields };
}
Expand Down

0 comments on commit 32729ae

Please sign in to comment.