title: WSO2 guaranteed delivery message In memory store
body: <p>Trying to make workable solution for guaranteed delivery In memory.</p>
  
  <p>Create InMemoryStore <strong>InMemMessageStore</strong>, create and point <strong>InsertInvoice</strong>
  create API so code looking like this :</p>
  
  <p>Sequence:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;sequence name="InMMSsequence" xmlns="http://ws.apache.org/ns/synapse"&gt;
      &lt;log level="custom"&gt;
          &lt;property name="STATE" value="message is sent to InMemMessageStore"/&gt;
      &lt;/log&gt;
      &lt;property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="True"/&gt;
      &lt;axis2ns12:store messageStore="InMemMessageStore" xmlns:axis2ns12="http://ws.apache.org/ns/synapse"/&gt; &lt;/sequence&gt;
  </code></pre>
  
  <p>my API looks like :</p>
  
  <pre><code> &lt;resource methods="POST" uri-template="/sendMessage"&gt;
        &lt;inSequence&gt;
           &lt;sequence key="InMMSsequence"/&gt;
        &lt;/inSequence&gt;
        &lt;outSequence/&gt;
        &lt;faultSequence/&gt;
     &lt;/resource&gt;
  </code></pre>
  
  <p>Message Processor :</p>
  
  <pre><code>&lt;messageProcessor name="MySMessageProcessor" class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" targetEndpoint="InsertInvoice" messageStore="InMemMessageStore" xmlns="http://ws.apache.org/ns/synapse"&gt;
     &lt;parameter name="interval"&gt;1000&lt;/parameter&gt;
     &lt;parameter name="client.retry.interval"&gt;1000&lt;/parameter&gt;
     &lt;parameter name="max.delivery.attempts"&gt;4&lt;/parameter&gt;
     &lt;parameter name="is.active"&gt;true&lt;/parameter&gt;
     &lt;parameter name="max.delivery.drop"&gt;Disabled&lt;/parameter&gt;
     &lt;parameter name="member.count"&gt;1&lt;/parameter&gt;
  &lt;/messageProcessor&gt;
  </code></pre>
  
  <p>And point :</p>
  
  <pre><code>   &lt;endpoint xmlns="http://ws.apache.org/ns/synapse"
      name="InsertInvoice"&gt;    
  &lt;http  uri-template="http://xxxx.xxx.xxx.xxx/InsertInvoiceVehicleList"
      method="post"&gt;
             &lt;suspendOnFailure&gt;
                &lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
             &lt;/suspendOnFailure&gt;
             &lt;markForSuspension&gt;
                &lt;retriesBeforeSuspension&gt;0&lt;/retriesBeforeSuspension&gt;
                &lt;retryDelay&gt;0&lt;/retryDelay&gt;
             &lt;/markForSuspension&gt;    &lt;/http&gt; &lt;/endpoint&gt;
  </code></pre>
  
  <p>PROBLEMS:</p>
  
  <ol>
  <li><p>over PostMan I'm sending the request in JSON format but when I open InMemMessageStore message is in XML ?!? Why?</p></li>
  <li><p>Endpoint expecting message in JSON format. Probably this is the reason of failure BUT on log I see something like </p></li>
  </ol>
  
  <p><strong>Failed to send the message through the fault sequence. Sequence name does not Exist.</strong></p>
  
  <p>Is the fault sequence mandatory or it is complaining because I don't have any default error sequence defines at all ?</p>
  
  <p>also </p>
  
  <p>Unable to sendViaPost to url[<a href="http://xxx.xxx.xx.xx/InsertInvoiceVehicleList/" rel="nofollow noreferrer">http://xxx.xxx.xx.xx/InsertInvoiceVehicleList/</a><strong>sendMessage</strong>]</p>
  
  <p>Why the <strong>'sendMessage'</strong> (This is uritemplate that is defined in API is added on endpoint url ?!?!)</p>
  
  <p>so : Biggest issue here is how to keep message in JSON format and how to keep endpoint url intact  ...</p>