use of org.apache.pulsar.common.api.proto.CommandLookupTopicResponse in project pulsar by apache.
the class Commands method newLookupResponseCommand.
public static BaseCommand newLookupResponseCommand(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, LookupType lookupType, long requestId, boolean proxyThroughServiceUrl) {
BaseCommand cmd = localCmd(Type.LOOKUP_RESPONSE);
CommandLookupTopicResponse response = cmd.setLookupTopicResponse().setResponse(lookupType).setRequestId(requestId).setAuthoritative(authoritative).setProxyThroughServiceUrl(proxyThroughServiceUrl);
if (brokerServiceUrl != null) {
response.setBrokerServiceUrl(brokerServiceUrl);
}
if (brokerServiceUrlTls != null) {
response.setBrokerServiceUrlTls(brokerServiceUrlTls);
}
return cmd;
}
use of org.apache.pulsar.common.api.proto.CommandLookupTopicResponse in project pulsar by apache.
the class Commands method newLookupErrorResponseCommand.
public static BaseCommand newLookupErrorResponseCommand(ServerError error, String errorMsg, long requestId) {
BaseCommand cmd = localCmd(Type.LOOKUP_RESPONSE);
CommandLookupTopicResponse response = cmd.setLookupTopicResponse().setRequestId(requestId).setError(error).setResponse(LookupType.Failed);
if (errorMsg != null) {
response.setMessage(errorMsg);
}
return cmd;
}
use of org.apache.pulsar.common.api.proto.CommandLookupTopicResponse in project pulsar by yahoo.
the class Commands method newLookupResponseCommand.
public static BaseCommand newLookupResponseCommand(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, LookupType lookupType, long requestId, boolean proxyThroughServiceUrl) {
BaseCommand cmd = localCmd(Type.LOOKUP_RESPONSE);
CommandLookupTopicResponse response = cmd.setLookupTopicResponse().setResponse(lookupType).setRequestId(requestId).setAuthoritative(authoritative).setProxyThroughServiceUrl(proxyThroughServiceUrl);
if (brokerServiceUrl != null) {
response.setBrokerServiceUrl(brokerServiceUrl);
}
if (brokerServiceUrlTls != null) {
response.setBrokerServiceUrlTls(brokerServiceUrlTls);
}
return cmd;
}
use of org.apache.pulsar.common.api.proto.CommandLookupTopicResponse in project pulsar by yahoo.
the class ServerCnxTest method testInvalidTopicOnLookup.
@Test(timeOut = 30000)
public void testInvalidTopicOnLookup() throws Exception {
resetChannel();
setChannelConnected();
String invalidTopicName = "xx/ass/aa/aaa";
resetChannel();
setChannelConnected();
channel.writeInbound(Commands.newLookup(invalidTopicName, true, 1));
Object obj = getResponse();
assertEquals(obj.getClass(), CommandLookupTopicResponse.class);
CommandLookupTopicResponse res = (CommandLookupTopicResponse) obj;
assertEquals(res.getError(), ServerError.InvalidTopicName);
channel.finish();
}
use of org.apache.pulsar.common.api.proto.CommandLookupTopicResponse in project incubator-pulsar by apache.
the class Commands method newLookupResponseCommand.
public static BaseCommand newLookupResponseCommand(String brokerServiceUrl, String brokerServiceUrlTls, boolean authoritative, LookupType lookupType, long requestId, boolean proxyThroughServiceUrl) {
BaseCommand cmd = localCmd(Type.LOOKUP_RESPONSE);
CommandLookupTopicResponse response = cmd.setLookupTopicResponse().setResponse(lookupType).setRequestId(requestId).setAuthoritative(authoritative).setProxyThroughServiceUrl(proxyThroughServiceUrl);
if (brokerServiceUrl != null) {
response.setBrokerServiceUrl(brokerServiceUrl);
}
if (brokerServiceUrlTls != null) {
response.setBrokerServiceUrlTls(brokerServiceUrlTls);
}
return cmd;
}
Aggregations