Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting selector is ineffective #158

Open
smanalysis opened this issue Jan 27, 2021 · 0 comments
Open

setting selector is ineffective #158

smanalysis opened this issue Jan 27, 2021 · 0 comments

Comments

@smanalysis
Copy link

smanalysis commented Jan 27, 2021

My server is Artemis 2.16, and js code is:

<script>
    $(document).ready(function() {
        let client = Stomp.client("ws://127.0.0.1:61613");
        // this allows to display debug logs directly on the web page
        client.debug = function (str) {
            console.log(str);
        };
        // the client is notified when it is connected to the server.
        // let headers = {"ack": "client", "selector": "location = 'Europe'"};
        let connected = function(frame) {
            client.subscribe("/test", function(message) {
                $("#messages").append("<p>" + message.body + "</p>\n");
            }, {"durable-subscription-name": "filter", "selector": "tag = 'aaa'"});
        };
        client.connect({"client-id": "abc"}, connected);
    });
</script>

but the setting of selector is ineffective (connection and subscribe is correct), the client can receive message with other tags, such as bbb . The debug output is:

>>> CONNECT
client-id:abc
accept-version:1.1,1.0
heart-beat:10000,10000

�
--- got data length: 130
<<< CONNECTED
version:1.1
session:6481f7fd
server:ActiveMQ-Artemis/2.16.0 ActiveMQ Artemis Messaging Engine
heart-beat:10000,10000

�

connected to server ActiveMQ-Artemis/2.16.0 ActiveMQ Artemis Messaging Engine
send PING every 10000ms
check PONG every 10000ms
>>> SUBSCRIBE
durable-subscription-name:filter
selector:tag = 'aaa'
id:sub-0
destination:/test

�
--- got data length: 256
<<< MESSAGE
subscription:sub-0
message-id:630
destination:test\c\cabc.filter
expires:0
redelivered:false
priority:4
persistent:true
timestamp:1611740949751
destination-type:ANYCAST
__AMQ_CID:e7417bfc-6084-11eb-b8bd-3cf011abac25
tag:bbb
content-length:4

MSG0�

Why???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant