Skip to content

TheSoftweyrGroup/Softweyr.WcfServiceBus

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Softweyr.WcfServiceBus

Extension to WCF allowing for simplified client access to services and a simplified "Service Bus" API.

The following SOA messaging patterns are supported (with examples),

  • Fire-and-forget: (1 to 1 Request):

    WcfServiceBus.Invoke<IMyServiceContract>(client => client.DoStuff("Get to work!"));

  • Request-Response (1 to 1 Request, 1 to 1 Response):

    var response = WcfServiceBus.Request<IMyServiceContract>(client => client.DoStuff("What is 1+1?"));

    or

    ServiceEndpoint responseEndpoint; WcfServiceBus.Request<IMyServiceContract>(client => client.DoStuff("What is 1+1?"), responseEndpoint);
  • Publish (1 to 0...N Request):

    WcfServiceBus.Publish<IMyServiceContract>(client => client.DoStuff("Lunch is ready!"));

  • Notify (1 to 1...N Request):

    WcfServiceBus.Notify<IMyServiceContract>(client => client.DoStuff("Someone needs to get this job done!"));

  • Probe (1 to 0...N Request, 0...N to 1 Response):

    var responses = WcfServiceBus.Probe<IMyServiceContract>(client => client.DoStuff("Anyone There?"), TimeSpan.FromSeconds(30));

    or

    ServiceEndpoint responseEndpoint;
    WcfServiceBus.Probe<IMyServiceContract>(client => client.DoStuff("Anyone There?"), responseEndpoint);

Publish and Notify have the following utility methods that are supported when using the WcfServiceBus discovery proxy. Endpoint susbcriptions can however be simply added to the service.model/client section of a configuration file or manually added to the WcfServiceBus discovery proxy

  • Susbcribe

    WcfServiceBus.Subscribe<IMyServiceContract>();

    or

    ServiceEndpoint endpoint;
    WcfServiceBus.Subscribe<IMyServiceContract>(endpoint);

  • Unsubscribe

    WcfServiceBus.Unsubscribe<IMyServiceContract>();

    or

    ServiceEndpoint endpoint;
    WcfServiceBus.Unsubscribe<IMyServiceContract>(endpoint);

Endpoint Configuration

Adding endpoints to the client part of a configuration file is the easiest way to add client endpoints.

Note: the only caveate is you need to make sure every endpoint has a unique name.

<system.servicemodel> <client> </client> </system.servicemodel>

About

Extension to WCF allowing for a simplified "Service Bus" type API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages