Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210350532
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210350532
Commits
253f807a
Commit
253f807a
authored
7 years ago
by
massakam
Committed by
Nozomi Kurihara
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ReaderHandler starts receiving messages after WebSocket session established (#944)
parent
da8acb27
No related branches found
Tags
v1.21.0-incubating
v1.21.0-incubating-candidate-3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ReaderHandler.java
+7
-1
7 additions, 1 deletion
.../main/java/org/apache/pulsar/websocket/ReaderHandler.java
with
7 additions
and
1 deletion
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ReaderHandler.java
+
7
−
1
View file @
253f807a
...
...
@@ -43,6 +43,7 @@ import org.apache.pulsar.common.naming.DestinationName;
import
org.apache.pulsar.common.util.DateFormatter
;
import
org.apache.pulsar.common.util.ObjectMapperFactory
;
import
org.apache.pulsar.websocket.data.ConsumerMessage
;
import
org.eclipse.jetty.websocket.api.Session
;
import
org.eclipse.jetty.websocket.api.WriteCallback
;
import
org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse
;
import
org.slf4j.Logger
;
...
...
@@ -87,7 +88,6 @@ public class ReaderHandler extends AbstractWebSocketHandler {
log
.
warn
(
"[{}:{}] Failed to add reader handler for topic {}"
,
request
.
getRemoteAddr
(),
request
.
getRemotePort
(),
topic
);
}
receiveMessage
();
}
catch
(
Exception
e
)
{
log
.
warn
(
"[{}:{}] Failed in creating reader {} on topic {}"
,
request
.
getRemoteAddr
(),
request
.
getRemotePort
(),
subscription
,
topic
,
e
);
...
...
@@ -161,6 +161,12 @@ public class ReaderHandler extends AbstractWebSocketHandler {
});
}
@Override
public
void
onWebSocketConnect
(
Session
session
)
{
super
.
onWebSocketConnect
(
session
);
receiveMessage
();
}
@Override
public
void
onWebSocketText
(
String
message
)
{
super
.
onWebSocketText
(
message
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment