-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: 1.1.0-GA
-
Fix Version/s: 2.0.0.B1
-
Component/s: amqp-dotnet-client
-
Labels:None
-
Environment:
Client on windows server 2012 r2
-
Target Release:
-
Sprint:January 2018
-
Affects:Release Notes
-
Release Notes Text:Pipelined protocol state events can prevent the client from raising link errors to the API user. Notification of errors may occur in subsequent event handling functions.
-
Release Notes Docs Status:Documented as Known Issue
.net lite client doesn't raise exception when receiver with wrong selector starts receiving messages from broker.
- When I call receiver.Receive() for the first time, it doesn't raise exception with invalid filter.
- When I call receiver.Receive() for second time, it raise AMQPException.
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
using System.Threading.Tasks; |
using System.Transactions; |
using Amqp; |
using Amqp.Framing; |
using Amqp.Types; |
|
|
namespace test |
{
|
class Selectors |
{
|
public static void Main(string[] args) |
{
|
Trace.TraceLevel = TraceLevel.Frame;
|
Trace.TraceListener = (f, a) => Console.WriteLine(DateTime.Now.ToString("[hh:ss.fff]") + " " + string.Format(f, a)); |
|
|
Address address = new Address("amqp://127.0.0.1:5672"); |
string queue = "test"; |
string testName = "Selectors"; |
|
|
Open open = new Open(); |
open.ContainerId = Guid.NewGuid().ToString();
|
Connection connection = new Connection(address, null, open, null); |
Session session = new Session(connection); |
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
Source recvSource = new Source(); |
recvSource.Address = queue;
|
Map filters = new Map(); |
filters.Add(new Symbol("filter1"), |
new DescribedValue( |
new Symbol("apache.org:selector-filter:string"), |
"foo/bar")); |
recvSource.FilterSet = filters;
|
|
|
Attach attach = new Attach() |
{
|
Source = recvSource,
|
Target = new Target(), |
};
|
|
|
ReceiverLink receiver = new ReceiverLink(session, "receiver-" + testName, attach, (l, a) => { }); |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////// |
//first try |
try { |
Message message = receiver.Receive(1000);
|
Console.WriteLine("Receiver doesn't raise exception"); |
}
|
catch (Exception ex) |
{
|
Console.WriteLine("Receiver raises exception: {0}", ex.Message); |
}
|
|
|
//second try |
try |
{
|
Message message = receiver.Receive(1000);
|
Console.WriteLine("Receiver doesn't raise exception"); |
}
|
catch (Exception ex) |
{
|
Console.WriteLine("Receiver raises exception: {0}", ex.Message); |
}
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
receiver.Close();
|
session.Close();
|
connection.Close();
|
|
|
Console.ReadLine();
|
}
|
}
|
}
|
client trace
[02:44.102] SEND AMQP 0 1.0.0
|
[02:44.118] SEND (ch=0) open(container-id:e82ab646-6652-4923-a54c-f08f96c4353a)
|
[02:44.118] RECV AMQP 0 1 0 0
|
[02:44.118] SEND (ch=0) begin(next-outgoing-id:4294967293,incoming-window:2048,outgoing-window:2048,handle-max:4294967295)
|
[02:44.133] RECV (ch=0) open(container-id:0.0.0.0,max-frame-size:4294967295,channel-max:65535,idle-time-out:30000,offered-capabilities:[sole-connection-for-container,DELA
|
YED_DELIVERY,SHARED-SUBS,ANONYMOUS-RELAY],properties:[product:apache-activemq-artemis,version:2.0.0.amq-700003-redhat-1])
|
[02:44.133] SEND (ch=0) attach(name:receiver-Selectors,handle:0,role:True,source:source(address:test,filter:[filter1:foo/bar]),target:target())
|
[02:44.133] RECV (ch=0) begin(remote-channel:0,next-outgoing-id:1,incoming-window:2147483647,outgoing-window:2147483647,handle-max:65535)
|
[02:44.133] SEND (ch=0) flow(next-in-id:0,in-window:2048,next-out-id:4294967293,out-window:2048,handle:0,delivery-count:0,link-credit:200,drain:False)
|
[02:44.133] RECV (ch=0) attach(name:receiver-Selectors,handle:0,role:False,snd-settle-mode:2,rcv-settle-mode:0,target:target(),incomplete-unsettled:False,initial-delivery
|
-count:0)
|
[02:44.149] RECV (ch=0) detach(handle:0,closed:True,error:error(condition:amqp:invalid-field,description:Invalid filter))
|
[02:44.149] SEND (ch=0) detach(handle:0,closed:True)
|
Receiver doesn't raise exception
|
Receiver raises exception: Invalid filter
|
[02:44.149] SEND (ch=0) end()
|
[02:44.149] RECV (ch=0) end()
|
[02:44.165] SEND (ch=0) close()
|
[02:44.165] RECV (ch=0) close()
|