本文整理了Java中org.apache.activemq.broker.region.Queue.getMessage
方法的一些代码示例,展示了Queue.getMessage
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Queue.getMessage
方法的具体详情如下:
包路径:org.apache.activemq.broker.region.Queue
类名称:Queue
方法名:getMessage
暂无
代码示例来源:origin: apache/activemq
public CompositeData getMessage(String messageId) throws OpenDataException {
CompositeData result = null;
QueueMessageReference ref = ((Queue)destination).getMessage(messageId);
if (ref != null) {
Message rc = ref.getMessage();
if (rc == null) {
return null;
}
result = OpenTypeSupport.convert(rc);
}
return result;
}
代码示例来源:origin: apache/activemq
/**
* Moves a message back to its original destination
*/
public boolean retryMessage(String messageId) throws Exception {
Queue queue = (Queue) destination;
QueueMessageReference ref = queue.getMessage(messageId);
Message rc = ref.getMessage();
if (rc != null) {
ActiveMQDestination originalDestination = rc.getOriginalDestination();
if (originalDestination != null) {
ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker());
return queue.moveMessageTo(context, ref, originalDestination);
}
else {
throw new JMSException("No original destination for message: "+ messageId);
}
}
else {
throw new JMSException("Could not find message: "+ messageId);
}
}
代码示例来源:origin: org.apache.activemq/activemq-all
public CompositeData getMessage(String messageId) throws OpenDataException {
CompositeData result = null;
QueueMessageReference ref = ((Queue)destination).getMessage(messageId);
if (ref != null) {
Message rc = ref.getMessage();
if (rc == null) {
return null;
}
result = OpenTypeSupport.convert(rc);
}
return result;
}
代码示例来源:origin: org.apache.activemq/activemq-broker
public CompositeData getMessage(String messageId) throws OpenDataException {
CompositeData result = null;
QueueMessageReference ref = ((Queue)destination).getMessage(messageId);
if (ref != null) {
Message rc = ref.getMessage();
if (rc == null) {
return null;
}
result = OpenTypeSupport.convert(rc);
}
return result;
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
public CompositeData getMessage(String messageId) throws OpenDataException {
CompositeData result = null;
QueueMessageReference ref = ((Queue)destination).getMessage(messageId);
if (ref != null) {
Message rc = ref.getMessage();
if (rc == null) {
return null;
}
result = OpenTypeSupport.convert(rc);
}
return result;
}
代码示例来源:origin: pierre/meteo
public CompositeData getMessage(String messageId) throws OpenDataException {
QueueMessageReference ref = ((Queue)destination).getMessage(messageId);
Message rc = ref.getMessage();
if (rc == null) {
return null;
}
return OpenTypeSupport.convert(rc);
}
代码示例来源:origin: org.apache.activemq/activemq-broker
/**
* Moves a message back to its original destination
*/
public boolean retryMessage(String messageId) throws Exception {
Queue queue = (Queue) destination;
QueueMessageReference ref = queue.getMessage(messageId);
Message rc = ref.getMessage();
if (rc != null) {
ActiveMQDestination originalDestination = rc.getOriginalDestination();
if (originalDestination != null) {
ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker());
return queue.moveMessageTo(context, ref, originalDestination);
}
else {
throw new JMSException("No original destination for message: "+ messageId);
}
}
else {
throw new JMSException("Could not find message: "+ messageId);
}
}
代码示例来源:origin: org.apache.activemq/activemq-all
/**
* Moves a message back to its original destination
*/
public boolean retryMessage(String messageId) throws Exception {
Queue queue = (Queue) destination;
QueueMessageReference ref = queue.getMessage(messageId);
Message rc = ref.getMessage();
if (rc != null) {
ActiveMQDestination originalDestination = rc.getOriginalDestination();
if (originalDestination != null) {
ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker());
return queue.moveMessageTo(context, ref, originalDestination);
}
else {
throw new JMSException("No original destination for message: "+ messageId);
}
}
else {
throw new JMSException("Could not find message: "+ messageId);
}
}
代码示例来源:origin: pierre/meteo
/**
* Moves a message back to its original destination
*/
public boolean retryMessage(String messageId) throws Exception {
Queue queue = (Queue) destination;
QueueMessageReference ref = queue.getMessage(messageId);
Message rc = ref.getMessage();
if (rc != null) {
ActiveMQDestination originalDestination = rc.getOriginalDestination();
if (originalDestination != null) {
ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker());
return queue.moveMessageTo(context, ref, originalDestination);
}
else {
throw new JMSException("No original destination for message: "+ messageId);
}
}
else {
throw new JMSException("Could not find message: "+ messageId);
}
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
/**
* Moves a message back to its original destination
*/
public boolean retryMessage(String messageId) throws Exception {
Queue queue = (Queue) destination;
QueueMessageReference ref = queue.getMessage(messageId);
Message rc = ref.getMessage();
if (rc != null) {
ActiveMQDestination originalDestination = rc.getOriginalDestination();
if (originalDestination != null) {
ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker());
return queue.moveMessageTo(context, ref, originalDestination);
}
else {
throw new JMSException("No original destination for message: "+ messageId);
}
}
else {
throw new JMSException("Could not find message: "+ messageId);
}
}
内容来源于网络,如有侵权,请联系作者删除!