Skip to content

1.0.0

Compare
Choose a tag to compare
@SimonCropp SimonCropp released this 28 Jul 00:41

Externalize RavenDb integration

The RavenDB integration has been extracted from the core to allow better support of RavenDB version changes moving forward.

RavenDB v2 will still remain merged within version 4 of NServiceBus.

Minimum dependencies

To use this new package you need the following minimum versions:

  • Raven Client 2.5.2908
  • Raven Server 2.5.2908
  • NServiceBus 4.1.0

Installation

In development environments

  • Stop endpoints. Ensure no endpoints are currently running or being debugged.
  • Uninstall the existing RavenDB server
    • If using a standard RavenDb msi then simply uninstall from Programs and Features.
    • If running an instance of RavenDB install via the Platform Installer then you will need to manually stop and disable the service. This can be done by managing the service named RavenDB in Computer Management or with the following command lines
      sc stop RavenDB
      sc config RavenDB start= disabled
  • Download ravendb 2.5
  • Install the new RavenDB version.
  • Ensure service is running. The easiest way to do this it by visiting http://localhost:8080/raven/studio.html
  • Install the nuget
    Install-Package NServiceBus.RavenDB
  • Update to the new API (see below)
  • Run and test

If you are maintaining different solutions that require different versions of RavenDB you will need to install the different versions on different ports.

If you want to keep your development data you will need to backup and restore that data manually.

Higher level environments (testing/production)

Note: RavenDB may change the file format of the database between versions, this upgrade is automatic and one way, This should be considered if a rollback to the previous version of RavenDB is required. Refer to the RavenDB upgrade documentation (http://ravendb.net/docs/2.5/server/administration/upgrade) for more information

Changes in the API usage

RavenDB integration, in both the core and the externalized versions, is configured using extension methods. Since these cannot be made distinct using namespace or type re-using the same extension method names would result in type conflicts. To avoid the conflicts the externalized version has had to slightly rename the extension points.

So where you would previously do :

Configure.With()
    .DefaultBuilder()
    .RavenPersistence()
    .RavenSagaPersister()
    .RavenSubscriptionStorage()
    .UseRavenTimeoutPersister() 
    .UseRavenGatewayDeduplication() 
    .UseRavenGatewayPersister();

With the externalized version you now do:

Configure.With()
    .DefaultBuilder()
    .RavenDBStorage() // Need to call this method
    .UseRavenDBSagaStorage() // Call this method to use Raven saga storage
    .UseRavenDBSubscriptionStorage() // Call this method to use Raven subscription storage
    .UseRavenDBTimeoutStorage() // Call this method to use Raven timeout storage
    .UseRavenDBGatewayDeduplicationStorage() // Call this method to use Raven deduplication storage for the Gateway
    .UseRavenDBGatewayStorage(); // Call this method to use the old Raven Gateway storage method

Data Migration of NServiceBus persisted types

No data migration is required when moving to this new externalized version. Data stored in the old can be read by the new externalized version. However data stored in the new format cannot be read in the old version. The result is that:

  • Once a system has moved over to the new externalized version it cannot be rolled back;
  • Endpoints cannot be updated in a side-by-side manner;

MSDTC fixes

The main push for this new approach is to incorporate some MSDTC fixes that have been included in RavenDB. This fix was included in version 2907 of RavenDB http://hibernatingrhinos.com/builds/ravendb-stable/2907. For more details on the most important DTC fix see http://issues.hibernatingrhinos.com/issue/RavenDB-2464 Note that this is the issue to track its inclusion in version 3.0 of RavenDB but is has been backported to 2907.

This issue was originally discussed in the Particular Software Group

Where to get it

You can download this release from nuget