Skip to content

Commit 8f2893b

Browse files
committed
Added latest SS.Text.dll
Add Message.Options to append behaviour
1 parent 821ef2b commit 8f2893b

File tree

10 files changed

+36
-5
lines changed

10 files changed

+36
-5
lines changed
0 Bytes
Binary file not shown.

lib/ServiceStack.OrmLite.dll

0 Bytes
Binary file not shown.

lib/ServiceStack.OrmLite.pdb

0 Bytes
Binary file not shown.

lib/ServiceStack.Text.dll

0 Bytes
Binary file not shown.

src/ServiceStack.Common/Messaging/MessageHandler.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Text;
3+
using ServiceStack.Common;
34
using ServiceStack.Logging;
45
using ServiceStack.Service;
56
using ServiceStack.ServiceClient.Web;
@@ -142,7 +143,11 @@ public void ProcessMessage(IMessageQueueClient mqClient, Message<T> message)
142143
//If there's no response publish the request message to its OutQ
143144
if (response == null)
144145
{
145-
mqClient.Notify(QueueNames<T>.Out, message.ToBytes());
146+
var messageOptions = (MessageOption)message.Options;
147+
if (messageOptions.Has(MessageOption.NotifyOneWay))
148+
{
149+
mqClient.Notify(QueueNames<T>.Out, message.ToBytes());
150+
}
146151
}
147152
else
148153
{

src/ServiceStack.Interfaces/Messaging/IMessage.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using ServiceStack.DataAnnotations;
23
using ServiceStack.DesignPatterns.Model;
34

45
namespace ServiceStack.Messaging
@@ -14,9 +15,11 @@ public interface IMessage
1415

1516
Guid? ReplyId { get; set; }
1617

17-
string ReplyTo { get; set; }
18+
string ReplyTo { get; set; }
1819

19-
MessageError Error { get; set; }
20+
int Options { get; set; }
21+
22+
MessageError Error { get; set; }
2023

2124
object Body { get; set; }
2225
}

src/ServiceStack.Interfaces/Messaging/MessageFactory.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Reflection;
4+
using ServiceStack.DataAnnotations;
45

56
namespace ServiceStack.Messaging
67
{
@@ -42,6 +43,7 @@ public class Message : IMessage
4243
public int RetryAttempts { get; set; }
4344
public Guid? ReplyId { get; set; }
4445
public string ReplyTo { get; set; }
46+
public int Options { get; set; }
4547
public MessageError Error { get; set; }
4648
public object Body { get; set; }
4749
}
@@ -57,6 +59,7 @@ public Message()
5759
{
5860
this.Id = Guid.NewGuid();
5961
this.CreatedDate = DateTime.UtcNow;
62+
this.Options = (int) MessageOption.NotifyOneWay;
6063
}
6164

6265
public Message(T body) : this()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
3+
namespace ServiceStack.Messaging
4+
{
5+
[Flags]
6+
public enum MessageOption : int
7+
{
8+
None = 0,
9+
All = int.MaxValue,
10+
11+
NotifyOneWay = 1 << 0,
12+
}
13+
}

src/ServiceStack.Interfaces/ServiceStack.Interfaces.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
<Compile Include="Messaging\MessageFactory.cs" />
163163
<Compile Include="Messaging\MessageError.cs" />
164164
<Compile Include="Messaging\MessageHandlerStats.cs" />
165+
<Compile Include="Messaging\MessageOption.cs" />
165166
<Compile Include="Messaging\MessagingException.cs" />
166167
<Compile Include="Messaging\QueueNames.cs" />
167168
<Compile Include="Messaging\UnRetryableMessagingException.cs" />
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
using NUnit.Framework;
1+
using System;
2+
using NUnit.Framework;
3+
using ServiceStack.Common;
4+
using ServiceStack.Messaging;
25

36
namespace ServiceStack.WebHost.IntegrationTests.Tests
47
{
58
[TestFixture]
69
public class SessionTests
710
{
8-
11+
[Test]
12+
public void Adhoc()
13+
{
14+
}
915
}
1016
}

0 commit comments

Comments
 (0)