Development Server


Everything in this document is based on an early preview of the Condense runtime. This preview is not publicly available.

Your Project Checklist

Reference Condense.Core.

Create your entities as POCO object. Decorate them with the Entity attribute.

Create your lambda methods, either on domain objects, or on service classes. Decorate these with the Lambda attribute. If on a service type, be sure to set the ContextType, you generally care that inputs have some sort of shared lineage. A lambda method on a domain object will use the type it is declared on (and the this pointer) as the context.

Create an interface for interoperability. Decorate this with the ServiceContract attribute.

Create interoperability methods. Input entity parameters are treated as new events. If a return type is specified the call will block until an event of that type occurs in the context of the inputs, and then the event entity will be returned.

Development Server Condense.Host.Development

This is a lightweight server which hosts your domain assemblies on the Condense runtime. It implements a single-node, single-thread hosting environment.

The recommended use is to configure your domain assembly’s project properties, in the Debug section, and set the Start Action to Start External Program, specifying …\Condense.Host.Development.exe. You should then configure the command line arguments to set the domain assembly of /da {your domain assembly}.dll.

By default, the server will run with an in-memory storage provider that does not persist. You may switch it to the Couchbase driver adding the /couchbase switch (see configuration below).

Similarly, it will run with an in-memory queue. While not recommended, you may use a properly configured AWS SQS / SNS driver, using the /AWS switch (see configuration below).

Diagnostics

The development server logs to the console, and sends UDP logs in standard format (Chainsaw, etc). As it uses NLog internally this can be further configured in the .config file.

Early logs will describe domain assembly parse information, and will record endpoints of any hosted integration services it discovers.

Interaction

The development server will host any integration interfaces at http://localhost:9002/{interfacename}. Use wcftestclient.exe or your tool of choice to interact with the domain.

Couchbase

The development server may talk to a Couchbase cluster.

Connection information must be specified in the Condense.Host.Development.exe.config file. The storage provider is currently hard-coded to use the bucket “default”. The GSI index must be created on this bucket, as the currently implementation uses N1QL queries for some data retrieval (this is likely to change to regular views for performance reasons).

<configuration>
    <configSections>
        <sectionGroup name="couchbaseClients">
            <section name="couchbase" type="Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.NetClient" />
        </sectionGroup>
    </configSections>

    <couchbaseClients>
        <couchbase useSsl="false">
            <servers>
                <add uri="http://127.0.0.1:8091/pools"></add>
            </servers>
        </couchbase>
    </couchbaseClients>
</configuration>

AWS SQS and SNS

The AWS driver is not recommended for development. It is designed for the Condense Cloud platform. This driver requires online connectivity, and charges from AWS may apply.

The Condense runtime will automatically create queues and notification topics that it requires. An appropriate AccessKey, SecretKey, and Region will need to be set in Condense.Host.Development.exe.config, from a user with reasonable permissions to access and create SNS and SQS queues.

  <appSettings>
    <add key="AWSAccessKey" value="AKIA..." />
    <add key="AWSSecretKey" value="..." />
    <add key="AWSRegion" value="ap-southeast-2" />
  </appSettings>

This requirement will change for production versions.

An entirely inappropriate policy for an IAM user to achieve this, that should defintely not be used is:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt999999999998",
            "Effect": "Allow",
            "Action": [
                "sqs:*"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Sid": "Stmt9999999999999",
            "Effect": "Allow",
            "Action": [
                "sns:*"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}