public class ConsumerHandler extends AbstractWebSocketHandler
receive: socket-proxy keeps pushing messages to client by writing into session. However, it dispatches N
messages at any point and after that on acknowledgement from client it dispatches further messages.
acknowledge: it accepts acknowledgement for a given message from client and send it to broker. and for next
action it notifies receive to dispatch further messages to client.
queryParams, request, service, topic| Constructor and Description |
|---|
ConsumerHandler(WebSocketService service,
javax.servlet.http.HttpServletRequest request,
org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse response) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static String |
extractSubscription(javax.servlet.http.HttpServletRequest request) |
long |
getAndResetNumBytesDelivered() |
long |
getAndResetNumMsgsAcked() |
long |
getAndResetNumMsgsDelivered() |
org.apache.pulsar.client.api.Consumer<byte[]> |
getConsumer() |
protected org.apache.pulsar.client.api.ConsumerBuilder<byte[]> |
getConsumerConfiguration(org.apache.pulsar.client.api.PulsarClient client) |
long |
getMsgDeliveredCounter() |
String |
getSubscription() |
org.apache.pulsar.client.api.SubscriptionMode |
getSubscriptionMode() |
org.apache.pulsar.client.api.SubscriptionType |
getSubscriptionType() |
protected Boolean |
isAuthorized(String authRole,
AuthenticationDataSource authenticationData) |
void |
onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session) |
void |
onWebSocketText(String message) |
protected void |
updateDeliverMsgStat(long msgSize) |
checkAuth, checkAuthentication, close, close, onWebSocketClose, onWebSocketErrorpublic ConsumerHandler(WebSocketService service, javax.servlet.http.HttpServletRequest request, org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse response)
public void onWebSocketConnect(org.eclipse.jetty.websocket.api.Session session)
onWebSocketConnect in interface org.eclipse.jetty.websocket.api.WebSocketConnectionListeneronWebSocketConnect in class AbstractWebSocketHandlerpublic void onWebSocketText(String message)
onWebSocketText in interface org.eclipse.jetty.websocket.api.WebSocketListeneronWebSocketText in class org.eclipse.jetty.websocket.api.WebSocketAdapterpublic void close()
throws IOException
IOExceptionpublic org.apache.pulsar.client.api.Consumer<byte[]> getConsumer()
public String getSubscription()
public org.apache.pulsar.client.api.SubscriptionType getSubscriptionType()
public org.apache.pulsar.client.api.SubscriptionMode getSubscriptionMode()
public long getAndResetNumMsgsDelivered()
public long getAndResetNumBytesDelivered()
public long getAndResetNumMsgsAcked()
public long getMsgDeliveredCounter()
protected void updateDeliverMsgStat(long msgSize)
protected org.apache.pulsar.client.api.ConsumerBuilder<byte[]> getConsumerConfiguration(org.apache.pulsar.client.api.PulsarClient client)
protected Boolean isAuthorized(String authRole, AuthenticationDataSource authenticationData) throws Exception
isAuthorized in class AbstractWebSocketHandlerExceptionpublic static String extractSubscription(javax.servlet.http.HttpServletRequest request)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.