• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MessagePostProcessor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.jms.core.MessagePostProcessor的典型用法代码示例。如果您正苦于以下问题:Java MessagePostProcessor类的具体用法?Java MessagePostProcessor怎么用?Java MessagePostProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MessagePostProcessor类属于org.springframework.jms.core包,在下文中一共展示了MessagePostProcessor类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: sendNewFiles

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
/**
 * Sends all files in directory to broker
 *
 * @param directory where files can be found
 * @param hasError if the reaction/aggregation ended with an error
 */
public void sendNewFiles(File directory, boolean hasError){

	String messageText = createMessageText(hasError, directory);
	jmsTemplate.convertAndSend(productQueue, messageText,
			new MessagePostProcessor() {
				public Message postProcessMessage(Message message) {
					try {
						message.setJMSCorrelationID(directory.getName());
					} catch (JMSException e) {
						e.printStackTrace();
					}
					return message;
				}
			});

}
 
开发者ID:wallerlab,项目名称:reaktor,代码行数:23,代码来源:FileTransporterService.java


示例2: errorDuringMsg

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
public void errorDuringMsg(final Map msg, Throwable t, final String lvl) {
    try {
    	
        getJmsTemplate().convertAndSend(MessageDestinations.DEAD_LETTER_QUEUE, SyncMessageUtils.createErrorMessage(msg, t, lvl), new MessagePostProcessor() {
            @Override
            public Message postProcessMessage(Message message) throws JMSException {
                message.setStringProperty(PATIENT_ID, (String) msg.get(PATIENT_ID)); // this enables us to select messages from the queue by pid
                message.setStringProperty(ERROR_LEVEL, lvl);
                return message;
            }
        });
        Object msgPid = msg.get(SyncMessageConstants.PATIENT_ID);
        if(msgPid!=null) {
            // FIXME: move this into metadata rather than on demographics object
            PatientDemographics pat = patientDao.findByPid(msg.get(SyncMessageConstants.PATIENT_ID).toString());
        	if(pat!=null) {
        		pat.incrementSyncErrorCount();
        		patientDao.save(pat);
        	}
        }
    } catch (JmsException e) {
        Object pid = msg.get(SyncMessageConstants.PATIENT_ID);
        String pidString = pid == null ? "" : String.valueOf(pid);
        log.error("unable to put error msg in error queue: " + t.getMessage() + "\n" + pidString, e);
    }
}
 
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:27,代码来源:SyncService.java


示例3: send

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Override
public void send(final T dto) throws Exception {
	this.getTemplatePublisher().convertAndSend(dto,
			new MessagePostProcessor() {
				@Override
				public Message postProcessMessage(final Message message)
						throws JMSException {
					if (logger.isDebugEnabled())
					{
						logger.debug("***** SENDING MESSAGE ******");
						traceMessage(message);
					}
					return message;
				}
			});
}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:17,代码来源:JMSSyncService.java


示例4: testStringProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testStringProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", "value");
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setStringProperty("key", "value");
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例5: testIntProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testIntProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", 1);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setIntProperty("key", 1);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例6: testLongProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testLongProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", 1L);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setLongProperty("key", 1L);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例7: testShortProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testShortProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", (short) 1);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setShortProperty("key", (short) 1);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例8: testByteProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testByteProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", (byte) 1);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setByteProperty("key", (byte) 1);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例9: testBooleanProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testBooleanProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", true);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setBooleanProperty("key", true);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例10: testFloatProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testFloatProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", (float) 1.5);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setFloatProperty("key", (float) 1.5);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例11: testObjectProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testObjectProperty() throws JMSException {
	Object object = new Object();
	MessagePostProcessor processor = createProcessor("key", object);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setObjectProperty("key", object);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:9,代码来源:PropertyMessagePostProcessorTest.java


示例12: onApplicationEvent

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Override
public void onApplicationEvent(ApplicationEvent applicationEvent) {
	if (applicationEvent instanceof ContextRefreshedEvent) {
		final String destinationName = "srs.release-build";
		messagingHelper.getJmsTemplate().convertAndSend(destinationName, "", new MessagePostProcessor() {
			@Override
			public Message postProcessMessage(Message message) throws JMSException {
				message.setStringProperty(MessagingHelper.AUTHENTICATION_TOKEN, "");
				message.setStringProperty(BuildTriggerMessageHandler.RELEASE_CENTER_KEY, "rc");
				message.setStringProperty(BuildTriggerMessageHandler.PRODUCT_KEY, "prod");
				message.setStringProperty(BuildTriggerMessageHandler.BUILD_ID, "build");
				return message;
			}
		});
	}
}
 
开发者ID:IHTSDO,项目名称:snomed-release-service,代码行数:17,代码来源:TestMessageSender.java


示例13: warningDuringMsg

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
public void warningDuringMsg(final Map msg, String warning) {
    getJmsTemplate().convertAndSend(MessageDestinations.WARNING_QUEUE, SyncMessageUtils.createWarningMessage(msg, warning), new MessagePostProcessor() {
        @Override
        public Message postProcessMessage(Message message) throws JMSException {
            message.setStringProperty(PATIENT_ID, (String) msg.get(PATIENT_ID)); // this enables us to select messages from the queue by pid
            return message;
        }
    });
}
 
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:10,代码来源:SyncService.java


示例14: sendErrorMessage

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
private void sendErrorMessage(final Map<String, Object> msg, Throwable t) {
	final String pid = (String) msg.get(SyncMessageConstants.PATIENT_ID);
	jms.convertAndSend(MessageDestinations.ERROR_QUEUE, SyncMessageUtils.createErrorMessage(msg, t, ErrorLevel.ERROR), new MessagePostProcessor() {
		@Override
		public Message postProcessMessage(Message message) throws JMSException {
			message.setStringProperty(SyncMessageConstants.PATIENT_ID, pid);
			return message;
		}
	});
}
 
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:11,代码来源:FrameEng.java


示例15: testDoubleProperty

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testDoubleProperty() throws JMSException {
	MessagePostProcessor processor = createProcessor("key", 1.5);
	Message message = mock(Message.class);
	processor.postProcessMessage(message);
	verify(message).setDoubleProperty("key", 1.5);
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:8,代码来源:PropertyMessagePostProcessorTest.java


示例16: sendRequest

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@RequestMapping(value = "/send-message/{sequence}", method = RequestMethod.POST)
@ResponseBody
   public String sendRequest(@PathVariable("sequence") final String sequence) {
	jmsTemplate.convertAndSend((Object)sequence,new MessagePostProcessor() {
        public Message postProcessMessage(Message message) throws JMSException {
            message.setStringProperty("CamelBeanMethodName", "execute");
            return message;
        }
    });		
	return "Message sent successfuly";
   }
 
开发者ID:valliappanr,项目名称:refreshable-beans,代码行数:12,代码来源:DynamicBeanController.java


示例17: testSendMessage

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
@Test
public void testSendMessage() {
	final String messageContent="10";
	jmsTemplate.convertAndSend((Object)messageContent,new MessagePostProcessor() {
        public Message postProcessMessage(Message message) throws JMSException {
            message.setStringProperty("CamelBeanMethodName", "execute");
            return message;
        }
    });		
}
 
开发者ID:valliappanr,项目名称:refreshable-beans,代码行数:11,代码来源:RefreshableServiceSendTest.java


示例18: setMessagePostProcessor

import org.springframework.jms.core.MessagePostProcessor; //导入依赖的package包/类
public void setMessagePostProcessor(MessagePostProcessor messagePostProcessor) {
	this.messagePostProcessor = messagePostProcessor;
}
 
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:4,代码来源:AsyncCommandHandlerImpl.java



注:本文中的org.springframework.jms.core.MessagePostProcessor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ColognePhonetic类代码示例发布时间:2022-05-22
下一篇:
Java ResourceSubscriber类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap