org.apache.activemq.ActiveMQConnectionFactory.setPrefetchPolicy()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.apache.activemq.ActiveMQConnectionFactory.setPrefetchPolicy()方法的一些代码示例,展示了ActiveMQConnectionFactory.setPrefetchPolicy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActiveMQConnectionFactory.setPrefetchPolicy()方法的具体详情如下:
包路径:org.apache.activemq.ActiveMQConnectionFactory
类名称:ActiveMQConnectionFactory
方法名:setPrefetchPolicy

ActiveMQConnectionFactory.setPrefetchPolicy介绍

[英]Sets the prefetch policy for consumers created by this connection.
[中]为此连接创建的使用者设置prefetch policy

代码示例

代码示例来源:origin: apache/activemq

public boolean buildFromMap(Map<String, Object> properties) {
  boolean rc = false;
  ActiveMQPrefetchPolicy p = new ActiveMQPrefetchPolicy();
  if (IntrospectionSupport.setProperties(p, properties, "prefetchPolicy.")) {
    setPrefetchPolicy(p);
    rc = true;
  }
  RedeliveryPolicy rp = new RedeliveryPolicy();
  if (IntrospectionSupport.setProperties(rp, properties, "redeliveryPolicy.")) {
    setRedeliveryPolicy(rp);
    rc = true;
  }
  BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy();
  if (IntrospectionSupport.setProperties(blobTransferPolicy, properties, "blobTransferPolicy.")) {
    setBlobTransferPolicy(blobTransferPolicy);
    rc = true;
  }
  rc |= IntrospectionSupport.setProperties(this, properties);
  return rc;
}

代码示例来源:origin: org.apache.james/james-server-queue-activemq

private ActiveMQConnectionFactory createActiveMQConnectionFactory(BlobTransferPolicy blobTransferPolicy) {
  ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://james?create=false");
  connectionFactory.setBlobTransferPolicy(blobTransferPolicy);
  connectionFactory.setPrefetchPolicy(createActiveMQPrefetchPolicy());
  return connectionFactory;
}

代码示例来源:origin: com.github.combinedmq/combinedmq

@Override
protected void init() {
  cfg = (ActiveMqConfiguration) getConfiguration();
  if (null == cf) {
    cf = new ActiveMQConnectionFactory();
  }
  Object value;
  if ((value = cfg.getBrokerUrl()) != null) cf.setBrokerURL(String.valueOf(value));
  if ((value = cfg.getUsername()) != null) cf.setUserName(String.valueOf(value));
  if ((value = cfg.getPassword()) != null) cf.setPassword(String.valueOf(value));
  ActiveMQPrefetchPolicy policy = new ActiveMQPrefetchPolicy();
  policy.setQueuePrefetch(1);
  cf.setPrefetchPolicy(policy);
}

代码示例来源:origin: org.apache.activemq/activemq-client

public boolean buildFromMap(Map<String, Object> properties) {
  boolean rc = false;
  ActiveMQPrefetchPolicy p = new ActiveMQPrefetchPolicy();
  if (IntrospectionSupport.setProperties(p, properties, "prefetchPolicy.")) {
    setPrefetchPolicy(p);
    rc = true;
  }
  RedeliveryPolicy rp = new RedeliveryPolicy();
  if (IntrospectionSupport.setProperties(rp, properties, "redeliveryPolicy.")) {
    setRedeliveryPolicy(rp);
    rc = true;
  }
  BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy();
  if (IntrospectionSupport.setProperties(blobTransferPolicy, properties, "blobTransferPolicy.")) {
    setBlobTransferPolicy(blobTransferPolicy);
    rc = true;
  }
  rc |= IntrospectionSupport.setProperties(this, properties);
  return rc;
}

代码示例来源:origin: pierre/meteo

public boolean buildFromMap(Map<String, Object> properties) {
  boolean rc = false;
  ActiveMQPrefetchPolicy p = new ActiveMQPrefetchPolicy();
  if (IntrospectionSupport.setProperties(p, properties, "prefetchPolicy.")) {
    setPrefetchPolicy(p);
    rc = true;
  }
  RedeliveryPolicy rp = new RedeliveryPolicy();
  if (IntrospectionSupport.setProperties(rp, properties, "redeliveryPolicy.")) {
    setRedeliveryPolicy(rp);
    rc = true;
  }
  BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy();
  if (IntrospectionSupport.setProperties(blobTransferPolicy, properties, "blobTransferPolicy.")) {
    setBlobTransferPolicy(blobTransferPolicy);
    rc = true;
  }
  rc |= IntrospectionSupport.setProperties(this, properties);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

public boolean buildFromMap(Map<String, Object> properties) {
  boolean rc = false;
  ActiveMQPrefetchPolicy p = new ActiveMQPrefetchPolicy();
  if (IntrospectionSupport.setProperties(p, properties, "prefetchPolicy.")) {
    setPrefetchPolicy(p);
    rc = true;
  }
  RedeliveryPolicy rp = new RedeliveryPolicy();
  if (IntrospectionSupport.setProperties(rp, properties, "redeliveryPolicy.")) {
    setRedeliveryPolicy(rp);
    rc = true;
  }
  BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy();
  if (IntrospectionSupport.setProperties(blobTransferPolicy, properties, "blobTransferPolicy.")) {
    setBlobTransferPolicy(blobTransferPolicy);
    rc = true;
  }
  rc |= IntrospectionSupport.setProperties(this, properties);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-all

public boolean buildFromMap(Map<String, Object> properties) {
  boolean rc = false;
  ActiveMQPrefetchPolicy p = new ActiveMQPrefetchPolicy();
  if (IntrospectionSupport.setProperties(p, properties, "prefetchPolicy.")) {
    setPrefetchPolicy(p);
    rc = true;
  }
  RedeliveryPolicy rp = new RedeliveryPolicy();
  if (IntrospectionSupport.setProperties(rp, properties, "redeliveryPolicy.")) {
    setRedeliveryPolicy(rp);
    rc = true;
  }
  BlobTransferPolicy blobTransferPolicy = new BlobTransferPolicy();
  if (IntrospectionSupport.setProperties(blobTransferPolicy, properties, "blobTransferPolicy.")) {
    setBlobTransferPolicy(blobTransferPolicy);
    rc = true;
  }
  rc |= IntrospectionSupport.setProperties(this, properties);
  return rc;
}

代码示例来源:origin: com.bbossgroups.rpc/bboss-rpc

BeanAccembleHelper.injectProperties(a,prefetchParams);
instance_.setPrefetchPolicy(a);            
RedeliveryPolicy r = new RedeliveryPolicy();
ProMap redirectParams = temp.getMap(connection_params_redirectPolicy);
  BeanAccembleHelper.injectProperties(a,prefetchParams);
instance_.setPrefetchPolicy(a);            
RedeliveryPolicy r = new RedeliveryPolicy();
ProMap redirectParams = (ProMap)temp.get(connection_params_redirectPolicy);

相关文章

微信公众号

最新文章

更多

ActiveMQConnectionFactory类方法