Message Persistence Edit on GitHub


The message persistence requires and adds these tables to your schema:

  1. jasper_incoming_envelopes - stores incoming and scheduled envelopes until they are successfully processed
  2. jasper_outgoing_envelopes - stores outgoing envelopes until they are successfully sent through the transports
  3. jasper_dead_letters - stores "dead letter" envelopes that could not be processed. See Dead Letter Envelopes for more information
  4. EnvelopeIdList - table type that is used by some of the functions listed below

and also these functions that are all used by the durable messaging in its "message recovery" functionality:

  1. uspDeleteIncomingEnvelopes
  2. uspDeleteOutgoingEnvelopes
  3. uspDiscardAndReassignOutgoing
  4. uspMarkIncomingOwnership
  5. uspMarkOutgoingOwnership

Managing the Sql Server Schema

In testing, you can build -- or rebuild -- the message storage in your system with a call to the RebuildMessageStorage() extension method off of either IWebHost or IJasperHost as shown below in a sample taken from xUnit integration testing with Jasper:


public class MyJasperAppFixture : IDisposable
{
    public MyJasperAppFixture()
    {
        Host = JasperHost.For<MyJasperApp>();

        // This extension method will blow away any existing
        // schema items for message persistence in your configured
        // database and then rebuilds the message persistence objects
        // before the *first* integration test runs
        Host.RebuildMessageStorage();
    }

    public IJasperHost Host { get;  }

    public void Dispose()
    {
        Host?.Dispose();
    }


}

// An xUnit test fixture that uses our MyJasperAppFixture
public class IntegrationTester : IClassFixture<MyJasperAppFixture>
{
    private readonly MyJasperAppFixture _fixture;

    public IntegrationTester(MyJasperAppFixture fixture)
    {
        _fixture = fixture;
    }
}

See this GitHub issue for some utilities to better manage the database objects.