congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SearchOffsetResponseHeader.getOffset
Code IndexAdd Tabnine to your IDE (free)

How to use
getOffset
method
in
org.apache.rocketmq.common.protocol.header.SearchOffsetResponseHeader

Best Java code snippets using org.apache.rocketmq.common.protocol.header.SearchOffsetResponseHeader.getOffset (Showing top 3 results out of 315)

origin: apache/rocketmq

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

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

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

Popular methods of SearchOffsetResponseHeader

  • setOffset

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • getSharedPreferences (Context)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Reference (javax.naming)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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