1 Reply Latest reply on Jan 4, 2009 10:49 PM by Ashok Sharma

    Use of different fields of "message" table

    Ashok Sharma Newbie

      Hi All,
      Can any one explain me the use of all the fields of message table?
      I will appreciate if any one defines the fields and their use in details.

      Thanks in advance...

        • 1. Re: Use of different fields of
          Ashok Sharma Newbie

          I have below information already, but looking for more detailed information
          1. Some basic information is documented in Message Store Guide
          2. Message table is basically used for message persistence, we can use DBMessageStoreImpl class to store message in Message table, with some classification.
          3. Message table is also used by RedeliverService to store message in case of error in action pipeline.

          But i have following doubts
          1. I send JMS message to my ESB service.
          2. I throws ActionProcessingException from first action (ExtractDataAction) of my action chain.
          3. Since i return null message, action chain processing stops.
          4. When i see the message table there i can find one record inserted with classification = DLQ and delivered = true.
          I am not sure why delivered is true, it should not be true because it's not delivered because of error in first action. I see the logger and ovserve no extra attempts are made to resend the message.
          5. Where can i see the attempts made to resend the message?
          6. Can i configure message store to store message in real text format?

          Below is my configuration file

          <?xml version = "1.0" encoding = "UTF-8"?>
          <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
          
           <providers>
           <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-URL="localhost"
           jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
           jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
          
           <jms-bus busid="send_railbill_gw_channel">
           <jms-message-filter dest-type="QUEUE" dest-name="queue/send_railbill_gw"/>
           </jms-bus>
           <jms-bus busid="send_railbill_esb_channel">
           <jms-message-filter dest-type="QUEUE" dest-name="queue/send_railbill_esb"/>
           </jms-bus>
          
           </jms-provider>
           </providers>
          
           <services>
           <service category="SendRailbillServiceESB" name="SendRailbillService" description="this service will send railbill on request">
           <listeners>
           <jms-listener name="send_railbill_gw_listener" busidref="send_railbill_gw_channel" maxThreads="1" is-gateway="true"/>
           <jms-listener name="send_railbill_esb_listener" busidref="send_railbill_esb_channel" maxThreads="1"/>
           </listeners>
           <actions mep="OneWay">
           <action name = "myNotifier" class="org.jboss.soa.esb.actions.Notifier">
           <property name="okMethod" value="notifyOK"/>
           <property name="exceptionMethod" value="notifyError" />
           <property name="notification-details">
           <NotificationList type="OK">
           <target name="consoleNotifier" class="NotifyConsole" />
           </NotificationList>
           <NotificationList type="err">
           <target class="NotifyFiles" >
           <file URI="E:/errorFile.txt" append="true"/>
           </target>
           </NotificationList>
           </property>
           </action>
          
           <!-- This action extract data from database -->
           <action name="ExtractDataAction" class="com.service.railbill.action.ExtractDataAction"> </action>
          
           <!-- This action transforms the java object in client specific format using smooks -->
           <action name="TransformShipmentData" class="com.service.railbill.action.TransformDataAction">
           <property name="smooksConfig" value="/smooks-config.xml"/>
           <property name="reportPath" value="E:/smooks-report.html" />
           </action>
          
           <!-- This action route the message to different service based on message property -->
           <action name="routingAction" class="org.jboss.soa.esb.actions.ContentBasedRouter">
           <property name="ruleSet" value="RoutingRules.drl"/>
           <property name="ruleReload" value="true"/>
           <property name="destinations">
           <route-to destination-name="FTP-destination" service-category="FTPServiceESBCategory" service-name="FTPServiceESB" />
           <route-to destination-name="SMTP-destination" service-category="SMTPServiceESBCategory" service-name="SMTPServiceESB" />
           </property>
           </action>
          
           </actions>
           </service>
           </services>
          
          </jbossesb>
          


          Below is my first action in action chain, bold line is causing the exception

          package com.service.railbill.action;
          
          import com.service.railbill.dataaccessObject.*;
          import com.service.railbill.valueObject.*;
          
          import java.io.ByteArrayOutputStream;
          import java.io.File;
          import java.io.IOException;
          import java.io.ObjectOutputStream;
          import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
          import org.jboss.soa.esb.actions.ActionProcessingFaultException;
          import org.jboss.soa.esb.helpers.ConfigTree;
          import org.jboss.soa.esb.message.Message;
          import org.jboss.soa.esb.services.persistence.MessageStore;
          import org.jboss.soa.esb.util.FileUtil;
          import org.jboss.soa.esb.actions.ActionProcessingException;
          import org.jboss.soa.esb.addressing.EPR;
          import org.jboss.soa.esb.addressing.PortReference;
          import org.jboss.soa.esb.addressing.eprs.LogicalEPR;
          import com.service.railbill.util.Validation;;
          
          
          
          //This class extract the shipment data for the given shipment id from database
          public class ExtractDataAction extends AbstractActionPipelineProcessor //AbstractActionLifecycle
          {
          
           protected ConfigTree _config;
          
           public ExtractDataAction(ConfigTree config) { _config = config; }
          
           //This is the default function which gets called from action chain processing.
           public Message process(Message message) throws ActionProcessingException
           {
           try{
           System.out.println("Entry into process method of ExtractDataAction:");
           ShipmentDAO shipDAO = new ShipmentDAO();
           Validation valiDation = new Validation();
           String shipmentID = (String)message.getProperties().getProperty("ShipmentID");
           String clientID = (String)message.getProperties().getProperty("ClientID");
           String transactionID = (String)message.getProperties().getProperty("TransactionID");
           String msgBody = (String)message.getBody().get();
           ShipmentDetailsVO shipmentDetailsVO = new ShipmentDetailsVO();
           ClientDetailsVO cdVO = new ClientDetailsVO();
          
           System.out.println("######## Message Details ########");
           System.out.println("Message property: ShipmentID = "+shipmentID);
           System.out.println("Message property: ClientID = "+clientID);
           System.out.println("Message property: TransactionID = "+transactionID);
           System.out.println("Message Body = "+msgBody);
           System.out.println("######## Message Details ########");
          
           //Start, get ClientDetailsVO and set it as message property
           cdVO = shipDAO.getClientDetailsForTransaction(clientID, transactionID);
           message.getProperties().setProperty("ClientDetails", cdVO);
           //End
          
           //Start, set ftp related information in message properties itself
           message.getProperties().setProperty("userName", cdVO.getUserName());
           message.getProperties().setProperty("password", cdVO.getUserPassword());
           message.getProperties().setProperty("IP", cdVO.getIP());
           message.getProperties().setProperty("ftpFolder", cdVO.getFtpFolderName());
           message.getProperties().setProperty("CommunicationMode", cdVO.getCommunicationMode());
           //End
          
           //Start, get shipment details and set it as message body in object format
           shipmentDetailsVO = shipDAO.getShipmentData(shipmentID);
           message.getBody().add(shipmentDetailsVO);
          
           causeException(); //this function will cause an exception to test notify err }
           catch(Exception ape)
           {
          
           message = null;
           System.out.println("IOException occured in ExtractDataAction: "+ape);
           throw new ActionProcessingException("Exception occured in ExtractDataAction", ape);
           }
          
           return message;
          
           }
          
           public void causeException() throws IOException
           {
           throw new IOException();
           }
          
          }