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

Issue#40-Not Closing HttpClient when reconnecting #62

Merged
merged 1 commit into from
Apr 16, 2020
Merged

Issue#40-Not Closing HttpClient when reconnecting #62

merged 1 commit into from
Apr 16, 2020

Conversation

mohitj13
Copy link
Contributor

fix: Not closing the httpClient after getting 401 error instead disconnecting the Bayeux client only
chore: Updating the cometd library

…nnecting the Bayeux client only

chore: Updating the cometd library
@mohitj13 mohitj13 mentioned this pull request Aug 29, 2019
@chandu1988
Copy link

Reconnect fails,
please provide the alternative solution for this application, how to reconnect dynamically.

@mohitj13
Copy link
Contributor Author

@chandu1988 This does not fix the disconnection but it tries to successfully reconnects when gets a disconnect message, as it does not stop the httpClient and just reconnect the Bayeux client only.

@chandu1988
Copy link

This does not fix the disconnection but it tries to successfully reconnects when gets a disconnect message, as it does not stop the httpClient and just reconnect the Bayeux client only
can u please provided the sample code?

@chandu1988
Copy link

can u please provided the sample code for reconnecting dynamically using httpClient and just reconnect the Bayeux client ?

@mohitj13
Copy link
Contributor Author

@chandu1988 this pr changes is all about that only. Look on the commits of this PR you can find the answer.

        @Override
        public void onMessage(ClientSessionChannel channel, Message message) {
            if (!message.isSuccessful()) {
                if (isError(message, ERROR_401) || isError(message, ERROR_403)) {
                    reauthenticate.set(true);
                    // stop(); this has been removed with disconnect method call
                    disconnect();
                    reconnect();
                }
            }

@chandu1988
Copy link

@chandu1988 this pr changes is all about that only. Look on the commits of this PR you can find the answer.

        @Override
        public void onMessage(ClientSessionChannel channel, Message message) {
            if (!message.isSuccessful()) {
                if (isError(message, ERROR_401) || isError(message, ERROR_403)) {
                    reauthenticate.set(true);
                    // stop(); this has been removed with disconnect method call
                    disconnect();
                    reconnect();
                }
            }

can u please provided the sample code for reconnecting dynamically using httpClient and just reconnect the Bayeux client where i can implement this code please let me know.. how can i refer this method can u please provide the code ...

@lmcalpin lmcalpin merged commit 11e8474 into forcedotcom:master Apr 16, 2020
@mohitj13 mohitj13 deleted the mohitj13/Issue#40-Not-clossing-httpclient branch November 10, 2020 00:15
@wsy89 wsy89 mentioned this pull request Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants