congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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 requests using okhttp
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JPanel (javax.swing)
  • JTable (javax.swing)
  • Top 25 Plugins for Webstorm
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