Codota Logo
GetMaxOffsetRequestHeader.setTopic
Code IndexAdd Codota to your IDE (free)

How to use
setTopic
method
in
org.apache.rocketmq.common.protocol.header.GetMaxOffsetRequestHeader

Best Java code snippets using org.apache.rocketmq.common.protocol.header.GetMaxOffsetRequestHeader.setTopic (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.headerGetMaxOffsetRequestHeadersetTopic

Popular methods of GetMaxOffsetRequestHeader

  • <init>
  • getQueueId
  • getTopic
  • setQueueId

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • runOnUiThread (Activity)
  • Path (java.nio.file)
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
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