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

Subscribe with a user specified id is not possible #6

Open
zaferaltug opened this issue Mar 13, 2023 · 1 comment
Open

Subscribe with a user specified id is not possible #6

zaferaltug opened this issue Mar 13, 2023 · 1 comment

Comments

@zaferaltug
Copy link

No description provided.

@zaferaltug
Copy link
Author

zaferaltug commented Mar 13, 2023

`

    public async Task SubscribeAsync(string topic, IDictionary<string, string> headers, EventHandler<StompMessage> handler)
    {
        if (StompState != StompConnectionState.Open)
            await Reconnect();

        headers.Add("destination", topic);
        if (!headers.ContainsKey("id"))
            headers.Add("id", $"sub-{_subscribers.Count}");
        var subscribeMessage = new StompMessage(StompCommand.Subscribe, headers);
        await _socket.SendInstant(_stompSerializer.Serialize(subscribeMessage));
        _subscribers.Add(topic, handler);
    }`

needs to be like this

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