Commit 1a5fb21 1 parent 2d7edbb commit 1a5fb21 Copy full SHA for 1a5fb21
File tree 2 files changed +9
-9
lines changed
Examples/Stomp.Net.Example.SimpleEventReceive
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 3
3
using System ;
4
4
using System . Text ;
5
5
using System . Threading ;
6
+ using System . Threading . Tasks ;
6
7
using Extend ;
7
8
8
9
#endregion
@@ -23,7 +24,6 @@ public class Program
23
24
//private const Int32 Port = 61613;
24
25
25
26
private const String QueueName = "TestQ" ;
26
- private const String SelectorKey = "selectorProp" ;
27
27
private const String User = "admin" ;
28
28
29
29
private static readonly ManualResetEventSlim _resetEvent = new ManualResetEventSlim ( ) ;
@@ -161,13 +161,13 @@ public void Start()
161
161
IDestination sourceQueue = _session . GetQueue ( QueueName ) ;
162
162
_consumer = _session . CreateConsumer ( sourceQueue ) ;
163
163
164
- _consumer . Listener += message =>
164
+ _consumer . Listener += async message =>
165
165
{
166
+ await Task . Delay ( 500 ) ;
167
+
166
168
var content = Encoding . UTF8 . GetString ( message . Content ) ;
167
169
Console . WriteLine ( $ " [{ Thread . CurrentThread . ManagedThreadId } ] { content } " ) ;
168
170
169
- Thread . Sleep ( 500 ) ;
170
-
171
171
message . Acknowledge ( ) ;
172
172
173
173
lock ( _sync )
Original file line number Diff line number Diff line change 1
- <Project Sdk =" Microsoft.NET.Sdk" >
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
2
<PropertyGroup >
3
3
<TargetFramework >netstandard1.3</TargetFramework >
4
4
<PackageId >Stomp.Net</PackageId >
13
13
<RepositoryType >git</RepositoryType >
14
14
<PackageTags >STOMP Apache.NMS Mq</PackageTags >
15
15
<GeneratePackageOnBuild >True</GeneratePackageOnBuild >
16
- <AssemblyVersion >2.0.0 .0</AssemblyVersion >
17
- <FileVersion >2.0.0 .0</FileVersion >
18
- <Version >2.0.0 .0</Version >
16
+ <AssemblyVersion >2.0.1 .0</AssemblyVersion >
17
+ <FileVersion >2.0.1 .0</FileVersion >
18
+ <Version >2.0.1 .0</Version >
19
19
<RootNamespace >Stomp.Net</RootNamespace >
20
20
<SignAssembly >True</SignAssembly >
21
21
<AssemblyOriginatorKeyFile >StompNet.snk</AssemblyOriginatorKeyFile >
29
29
<LangVersion >latest</LangVersion >
30
30
</PropertyGroup >
31
31
<ItemGroup >
32
- <PackageReference Include =" extend" Version =" 1.2.0.107 " />
32
+ <PackageReference Include =" extend" Version =" 1.2.0.108 " />
33
33
<PackageReference Include =" System.Net.NameResolution" Version =" 4.3.0" />
34
34
<PackageReference Include =" System.Net.Security" Version =" 4.3.2" />
35
35
<PackageReference Include =" System.Threading.Thread" Version =" 4.3.0" />
You can’t perform that action at this time.
0 commit comments