-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
177 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
src/ArtemisNetCoreClient/Framing/SessionConsumerCloseMessage.cs
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
src/ArtemisNetCoreClient/Framing/SessionConsumerCloseMessage2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace ActiveMQ.Artemis.Core.Client.Framing; | ||
|
||
internal class SessionConsumerCloseMessage2 : Packet | ||
{ | ||
public const byte Type = 74; | ||
|
||
public long ConsumerId { get; set; } | ||
|
||
public override void Encode(ByteBuffer buffer) | ||
{ | ||
buffer.WriteLong(ConsumerId); | ||
} | ||
|
||
public override void Decode(ByteBuffer buffer) | ||
{ | ||
} | ||
} | ||
|
||
internal readonly struct SessionConsumerCloseMessage : IOutgoingPacket | ||
{ | ||
public PacketType PacketType => PacketType.SessionConsumerCloseMessage; | ||
public required long ConsumerId { get; init; } | ||
public int GetRequiredBufferSize() | ||
{ | ||
return sizeof(long); | ||
} | ||
|
||
public int Encode(Span<byte> buffer) | ||
{ | ||
return ArtemisBinaryConverter.WriteInt64(ref buffer.GetReference(), ConsumerId); | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
src/ArtemisNetCoreClient/Framing/SessionCreateConsumerMessage.cs
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
src/ArtemisNetCoreClient/Framing/SessionCreateConsumerMessage2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
namespace ActiveMQ.Artemis.Core.Client.Framing; | ||
|
||
internal class SessionCreateConsumerMessage2 : Packet | ||
{ | ||
public const byte Type = 40; | ||
|
||
public required long Id { get; init; } | ||
public required string QueueName { get; init; } | ||
public string? FilterString { get; init; } | ||
public required int Priority { get; init; } | ||
public required bool BrowseOnly { get; init; } | ||
public required bool RequiresResponse { get; init; } | ||
|
||
public override void Encode(ByteBuffer buffer) | ||
{ | ||
buffer.WriteLong(Id); | ||
buffer.WriteByteString(QueueName); | ||
buffer.WriteNullableByteString(FilterString); | ||
buffer.WriteBool(BrowseOnly); | ||
buffer.WriteBool(RequiresResponse); | ||
buffer.WriteInt(Priority); | ||
} | ||
|
||
public override void Decode(ByteBuffer buffer) | ||
{ | ||
} | ||
} | ||
|
||
internal readonly struct SessionCreateConsumerMessage : IOutgoingPacket | ||
{ | ||
public PacketType PacketType => PacketType.SessionCreateConsumerMessage; | ||
|
||
public required long Id { get; init; } | ||
public required string QueueName { get; init; } | ||
public required string? FilterString { get; init; } | ||
public required bool BrowseOnly { get; init; } | ||
public required bool RequiresResponse { get; init; } | ||
public required int Priority { get; init; } | ||
|
||
|
||
public int GetRequiredBufferSize() | ||
{ | ||
int byteCount = 0; | ||
|
||
byteCount += sizeof(long); // Id | ||
byteCount += ArtemisBinaryConverter.GetSimpleStringByteCount(QueueName); | ||
byteCount += ArtemisBinaryConverter.GetNullableSimpleStringByteCount(FilterString); | ||
byteCount += sizeof(bool); // BrowseOnly | ||
byteCount += sizeof(bool); // RequiresResponse | ||
byteCount += sizeof(int); // Priority | ||
|
||
return byteCount; | ||
} | ||
|
||
public int Encode(Span<byte> buffer) | ||
{ | ||
var offset = 0; | ||
|
||
offset += ArtemisBinaryConverter.WriteInt64(ref buffer.GetOffset(offset), Id); | ||
offset += ArtemisBinaryConverter.WriteSimpleString(ref buffer.GetOffset(offset), QueueName); | ||
offset += ArtemisBinaryConverter.WriteNullableSimpleString(ref buffer.GetOffset(offset), FilterString); | ||
offset += ArtemisBinaryConverter.WriteBool(ref buffer.GetOffset(offset), BrowseOnly); | ||
offset += ArtemisBinaryConverter.WriteBool(ref buffer.GetOffset(offset), RequiresResponse); | ||
offset += ArtemisBinaryConverter.WriteInt32(ref buffer.GetOffset(offset), Priority); | ||
|
||
return offset; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters