Codota Logo
GetMaxOffsetRequestHeader.<init>
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
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
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
  • getSystemService (Context)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now