You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/24 05:00:19 UTC
[GitHub] k2la opened a new pull request #2829: Fix Websocket Consume
Messages in Partitioned Topics
k2la opened a new pull request #2829: Fix Websocket Consume Messages in Partitioned Topics
URL: https://github.com/apache/pulsar/pull/2829
### Motivation
When clients consumed messages in partitioned topics on websocket, it occurred above errors:
```
15:46:31.854 [pulsar-web-28-8] WARN o.a.pulsar.websocket.ConsumerHandler - Unhandled Error (closing connection)
java.lang.NullPointerException: null
at org.apache.pulsar.client.impl.MultiTopicsConsumerImpl.doAcknowledge(MultiTopicsConsumerImpl.java:384) ~[pulsar-client-original-2.1.1.2-incubating-yjrelease.jar:2.1.1-incubating]
at org.apache.pulsar.client.impl.ConsumerBase.acknowledgeAsync(ConsumerBase.java:243) ~[pulsar-client-original-2.1.1.2-incubating-yjrelease.jar:2.1.1-incubating]
at org.apache.pulsar.websocket.ConsumerHandler.onWebSocketText(ConsumerHandler.java:238) ~[pulsar-websocket-2.1.1.2-incubating-yjrelease.jar:2.1.1-incubating]
at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextMessage(JettyListenerEventDriver.java:189) ~[websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69) ~[websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:66) ~[websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onTextFrame(JettyListenerEventDriver.java:158) ~[websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:162) ~[websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:376) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.extensions.AbstractExtension.nextIncomingFrame(AbstractExtension.java:176) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.nextIncomingFrame(PerMessageDeflateExtension.java:105) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.incomingFrame(PerMessageDeflateExtension.java:70) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:220) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:256) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:679) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:511) [websocket-common-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:202) [jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1
```
### Modifications
- Add `public` to `TopicMessageIdImpl` class.
- Parse messages and get a partitioned topic name.
- If a message is from a partitioned topic, `msgId` changes `TopicMessageIdImpl` instance.
### Result
When clients are able to consume messages in partitioned topics on websocket.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services