当前位置: 首页>>代码示例>>Java>>正文


Java MessagePostProcessor类代码示例

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


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


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