Skip to content

Commit

Permalink
BodyString支持设置。close: #80
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Sep 9, 2024
1 parent be786a0 commit 616f1d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NewLife.RocketMQ/Protocol/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Message

private String _BodyString;
/// <summary>消息体。字符串格式</summary>
public String BodyString => _BodyString ??= Body?.ToStr();
public String BodyString { get => _BodyString ??= Body?.ToStr(); set => Body = (_BodyString = value)?.GetBytes(); }

/// <summary>等待存储消息</summary>
public Boolean WaitStoreMsgOK { get; set; } = true;
Expand All @@ -50,6 +50,7 @@ public class Message
/// <param name="body"></param>
public void SetBody(Object body)
{
_BodyString = null;
if (body is Packet pk)
Body = pk.ReadBytes();
else if (body is Byte[] buf)
Expand Down

0 comments on commit 616f1d1

Please sign in to comment.