SimpleBus serializes and deserializes objects for sending and receiving them as messages. Serialization is abstracted, and concrete types are chosen by the user in endpoint configuration. SimpleBus ships with a built-in XML serializer, and other serializers are provided by other packages. Due to the widespread use of JSON, we would like to add a built-in JSON serializer to SimpleBus.
- Have explicit dependencies passed in via
Initialize
- Should be used for non optional core "things"
- Can provide public api via
FeatureSetupContext
- Uses the SettingsHolder to hold onto settings
- Provided via the ctor
- Should be exposed as
ReadOnlySettings
internally
- Can be started and stopped
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var routerConfiguation = new RouterConfiguration("Router"); | |
routerConfiguation.AddInterface<MsmqTransport>("MSMQ").DisableMessageDrivenPublishSubscribe(); | |
routerConfiguation.AddInterface<SqlServerTransport>("SQL", t => t.ConnectionString(myConnectionString)).DisableMessageDrivenPublishSubscribe(); | |
routerConfiguation.Chains.AddRule(c => new MetricsPreroutingTerminator("MSMQ", "Particular.Monitoring@some-machine")); | |
routerConfiguation.UseStaticRoutingProtocol(); | |
var router = Router.Create(routerConfiguation); | |
await router.Start().ConfigureAwait(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using NServiceBus; | |
using NServiceBus.MessageInterfaces; | |
using NServiceBus.Serialization; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Projects ChangesAgents6Build Queue0 | |
Andreas Öhlund Administration | |
Run... | |
Actions | |
Edit Configuration Settings | |
NServiceBusNServiceBus.Gateway3.1 Test (.NET Framework on Windows) | |
#3.0.1-PullRequest0099.30 (28 Sep 18 11:20) | |
Overview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this is called to push messages onto ASQ from the browser | |
sendMessage(queueKey, message) { | |
let json = this.orderedJsonStringify(message); | |
let encodedMessage = btoa(json); | |
let url = this.tokens[queueKey]; //this is the url for the queue including SAS token for auth. This is stored in a JWT token created at login | |
this.fetch(url, | |
{ | |
method: 'post', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<InventoryStatusResponse> GetInventoryStatus(string id) | |
{ | |
var numRetries = 0; | |
var siteId = "228202-91B"; | |
do | |
{ | |
try | |
{ | |
using (var client = new HttpClient()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MSMQ; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//add ref to mqoa30.tlb https://stackoverflow.com/a/8258952/236004 | |
var localMsmq = new MSMQApplication(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TimeoutHandlerIssueDetector : Feature | |
{ | |
public TimeoutHandlerIssueDetector() | |
{ | |
EnableByDefault(); | |
} | |
protected override void Setup(FeatureConfigurationContext context) | |
{ | |
context.RegisterStartupTask(b => new DetectReusedMessages(b.Build<MessageHandlerRegistry>())); |
NewerOlder