Tabnine Logo
GetMaxOffsetRequestHeader.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.rocketmq.common.protocol.header.GetMaxOffsetRequestHeader
constructor

Best Java code snippets using org.apache.rocketmq.common.protocol.header.GetMaxOffsetRequestHeader.<init> (Showing top 3 results out of 315)

origin: apache/rocketmq

public long getMaxOffset(final String addr, final String topic, final int queueId, final long timeoutMillis)
  throws RemotingException, MQBrokerException, InterruptedException {
  GetMaxOffsetRequestHeader requestHeader = new GetMaxOffsetRequestHeader();
  requestHeader.setTopic(topic);
  requestHeader.setQueueId(queueId);
  RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_MAX_OFFSET, requestHeader);
  RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr),
    request, timeoutMillis);
  assert response != null;
  switch (response.getCode()) {
    case ResponseCode.SUCCESS: {
      GetMaxOffsetResponseHeader responseHeader =
        (GetMaxOffsetResponseHeader) response.decodeCommandCustomHeader(GetMaxOffsetResponseHeader.class);
      return responseHeader.getOffset();
    }
    default:
      break;
  }
  throw new MQBrokerException(response.getCode(), response.getRemark());
}
origin: didi/DDMQ

public long getMaxOffset(final String addr, final String topic, final int queueId, final long timeoutMillis)
  throws RemotingException, MQBrokerException, InterruptedException {
  GetMaxOffsetRequestHeader requestHeader = new GetMaxOffsetRequestHeader();
  requestHeader.setTopic(topic);
  requestHeader.setQueueId(queueId);
  RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_MAX_OFFSET, requestHeader);
  RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr),
    request, timeoutMillis);
  assert response != null;
  switch (response.getCode()) {
    case ResponseCode.SUCCESS: {
      GetMaxOffsetResponseHeader responseHeader =
        (GetMaxOffsetResponseHeader) response.decodeCommandCustomHeader(GetMaxOffsetResponseHeader.class);
      return responseHeader.getOffset();
    }
    default:
      break;
  }
  throw new MQBrokerException(response.getCode(), response.getRemark());
}
origin: org.apache.rocketmq/rocketmq-client

public long getMaxOffset(final String addr, final String topic, final int queueId, final long timeoutMillis)
  throws RemotingException, MQBrokerException, InterruptedException {
  GetMaxOffsetRequestHeader requestHeader = new GetMaxOffsetRequestHeader();
  requestHeader.setTopic(topic);
  requestHeader.setQueueId(queueId);
  RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_MAX_OFFSET, requestHeader);
  RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr),
    request, timeoutMillis);
  assert response != null;
  switch (response.getCode()) {
    case ResponseCode.SUCCESS: {
      GetMaxOffsetResponseHeader responseHeader =
        (GetMaxOffsetResponseHeader) response.decodeCommandCustomHeader(GetMaxOffsetResponseHeader.class);
      return responseHeader.getOffset();
    }
    default:
      break;
  }
  throw new MQBrokerException(response.getCode(), response.getRemark());
}
org.apache.rocketmq.common.protocol.headerGetMaxOffsetRequestHeader<init>

Popular methods of GetMaxOffsetRequestHeader

  • getQueueId
  • getTopic
  • setQueueId
  • setTopic

Popular in Java

  • Making http post requests using okhttp
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now