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

How to use
getPrefetch
method
in
org.apache.activemq.command.ConsumerControl

Best Java code snippets using org.apache.activemq.command.ConsumerControl.getPrefetch (Showing top 20 results out of 315)

Refine searchRefine arrow

  • ConsumerControl.getConsumerId
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());

  }
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

public void connectionInterruptProcessingComplete(Transport transport, ConnectionId connectionId) {
  ConnectionState connectionState = connectionStates.get(connectionId);
  if (connectionState != null) {
    connectionState.setConnectionInterruptProcessingComplete(true);
    Map<ConsumerId, ConsumerInfo> stalledConsumers = connectionState.getRecoveringPullConsumers();
    for (Entry<ConsumerId, ConsumerInfo> entry: stalledConsumers.entrySet()) {
      ConsumerControl control = new ConsumerControl();
      control.setConsumerId(entry.getKey());
      control.setPrefetch(entry.getValue().getPrefetchSize());
      control.setDestination(entry.getValue().getDestination());
      try {
        if (LOG.isDebugEnabled()) {
          LOG.debug("restored recovering consumer: " + control.getConsumerId() + " with: " + control.getPrefetch());
        }
        transport.oneway(control);
      } catch (Exception ex) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Failed to submit control for consumer: " + control.getConsumerId()
              + " with: " + control.getPrefetch(), ex);
        }
      }
    }
    stalledConsumers.clear();
  }
}
origin: apache/activemq

protected void onConsumerControl(ConsumerControl command) {
  if (command.isClose()) {
    for (ActiveMQSession session : this.sessions) {
      session.close(command.getConsumerId());
    }
  } else {
    for (ActiveMQSession session : this.sessions) {
      session.setPrefetchSize(command.getConsumerId(), command.getPrefetch());
    }
    for (ActiveMQConnectionConsumer connectionConsumer: connectionConsumers) {
      ConsumerInfo consumerInfo = connectionConsumer.getConsumerInfo();
      if (consumerInfo.getConsumerId().equals(command.getConsumerId())) {
        consumerInfo.setPrefetchSize(command.getPrefetch());
      }
    }
  }
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

  /**
   * Write the booleans that this object uses to a BooleanStream
   */
  public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

    ConsumerControl info = (ConsumerControl)o;

    super.looseMarshal(wireFormat, o, dataOut);
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
    dataOut.writeBoolean(info.isClose());
    looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut);
    dataOut.writeInt(info.getPrefetch());
    dataOut.writeBoolean(info.isFlush());
    dataOut.writeBoolean(info.isStart());
    dataOut.writeBoolean(info.isStop());

  }
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
  bs.readBoolean();
  bs.readBoolean();
  bs.readBoolean();
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
  bs.readBoolean();
  bs.readBoolean();
  bs.readBoolean();
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
  bs.readBoolean();
  bs.readBoolean();
  bs.readBoolean();
}
origin: apache/activemq

@Override
public void processConsumerControl(ConsumerBrokerExchange consumerExchange, ConsumerControl control) {
  Subscription sub = subscriptions.get(control.getConsumerId());
  if (sub != null && sub instanceof AbstractSubscription) {
    ((AbstractSubscription) sub).setPrefetchSize(control.getPrefetch());
    if (broker.getDestinationPolicy() != null) {
      PolicyEntry entry = broker.getDestinationPolicy().getEntryFor(control.getDestination());
      if (entry != null) {
        entry.configurePrefetch(sub);
      }
    }
    LOG.debug("setting prefetch: {}, on subscription: {}; resulting value: {}", new Object[]{ control.getPrefetch(), control.getConsumerId(), sub.getConsumerInfo().getPrefetchSize()});
    try {
      lookup(consumerExchange.getConnectionContext(), control.getDestination(),false).wakeup();
    } catch (Exception e) {
      LOG.warn("failed to deliver post consumerControl dispatch-wakeup, to destination: {}", control.getDestination(), e);
    }
  }
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
  bs.readBoolean();
  bs.readBoolean();
  bs.readBoolean();
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
  bs.readBoolean();
  bs.readBoolean();
  bs.readBoolean();
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
  bs.readBoolean();
  bs.readBoolean();
  bs.readBoolean();
}
origin: apache/activemq

/**
 * Write a object instance to data output stream
 *
 * @param o the instance to be marshaled
 * @param dataOut the output stream
 * @throws IOException thrown if an error occurs
 */
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
  super.tightMarshal2(wireFormat, o, dataOut, bs);
  ConsumerControl info = (ConsumerControl)o;
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs);
  bs.readBoolean();
  tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs);
  dataOut.writeInt(info.getPrefetch());
  bs.readBoolean();
  bs.readBoolean();
  bs.readBoolean();
}
org.apache.activemq.commandConsumerControlgetPrefetch

Popular methods of ConsumerControl

  • <init>
  • setConsumerId
  • setPrefetch
  • setDestination
  • getConsumerId
  • getDestination
  • setClose
  • isClose
  • isFlush
  • isStart
  • isStop
  • setFlush
  • isStop,
  • setFlush,
  • setStart,
  • setStop

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Path (java.nio.file)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JOptionPane (javax.swing)
  • Top 12 Jupyter Notebook Extensions
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