/* * Copyright (c) 2009 Ventyx, Inc. * 3301 Windy Ridge Parkway, Atlanta, Georgia, 30339, U.S.A. * All rights reserved. */ package com.ventyx.soi.proto.as; import org.apache.camel.builder.RouteBuilder; import org.apache.log4j.Logger; /** * This is the prototype Connection Handler component of a connector to Asset * Suite. It routes messages to and from the File Binding components to and from * both the Publisher and Service Handler components. * * @version $Revision: 1.1 $ */ public class SOIProtoASFileChannelRouter extends RouteBuilder { /** LOG4J logger Declaration. */ private static final Logger LOGGER = Logger .getLogger(SOIProtoASFileChannelRouter.class); /** * Establishes routing and filtering for the SOI Connector. */ public final void configure() { if (LOGGER.isInfoEnabled()) { LOGGER.info("Entered configure()"); } /*messages that cannot be delivered are sent to a Dead Letter Queue */ errorHandler(deadLetterChannel("activemq:queue:SOIDeadLetterQueue") .maximumRedeliveries(0).useExponentialBackOff()); /******************************************************************************* * FROM ASSET SUITE BC - Inbound messages from Asset Suite to the AS RMD Queue ******************************************************************************/ /** * Handle messages send from the BC (in this case the file poller), * The channel adapter in this case only passes the message onto the RMD * queue for the AS connector. */ from("jbi:service:http://ventyx.com/AS/inputChannel") .convertBodyTo(String.class) .setHeader("TargetComponent", constant("ASPublish")) .multicast() .to("activemq:queue:RMDASConnector") .to("log:IncomingPublisherMessage"); if (LOGGER.isInfoEnabled()) { LOGGER.info("Leaving configure"); } /******************************************************************************* * FROM ASSET SUITE Service Handler - Outbound messages from the AS RMD Queue ******************************************************************************/ /** * Get message from the AS RMD Queue via the JMS-SU selective consumer. * Then pass it to the file sender. */ from("jbi:service:http://ventyx.com/AS/fileCAASMessage") .to("jbi:endpoint:http://ventyx.com/AS/file/sender"); if (LOGGER.isInfoEnabled()) { LOGGER.info("Leaving configure"); } } } // end of SOIProtoASFileChannelRouter