This file contains hidden or 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
$ServiceName = "the service" | |
$service = Get-Service $ServiceName -ErrorAction SilentlyContinue | |
Start-Service $ServiceName |
This file contains hidden or 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
$service = Get-Service "the service" -ErrorAction SilentlyContinue | |
if ($service) | |
{ | |
"Backend service is already installed, going to uninstall first" | |
#get the path to the current service | |
$servicePath = "HKLM:SYSTEM\CurrentControlSet\Services\$service" | |
$serviceKey = get-itemproperty -path $servicePath -ErrorAction silentlycontinue |
This file contains hidden or 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
$serviceName = "the name of the service" | |
$service = Get-Service $serviceName -ErrorAction SilentlyContinue | |
if ($service) | |
{ | |
Stop-Service $ServiceName -Force | |
Start-Sleep -s 10 | |
if($service.Status -ne 'stopped' ){ |
This file contains hidden or 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
void IManageUnitsOfWork.End(Exception ex) | |
{ | |
if (SessionFactory == null || currentSession == null) return; | |
if (ex != null) | |
{ | |
Transaction.Current.Rollback(ex); | |
while (Transaction.Current.TransactionInformation.Status != TransactionStatus.Aborted) | |
{ |
This file contains hidden or 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 RestSharp; | |
var client = new RestClient("http://localhost:8888/api"); | |
var request = new RestRequest("endpoints", Method.GET); | |
var response = client.Execute<List<Endpoint>>(request); | |
foreach(var endpoint in response.Data) | |
{ | |
Console.Out.WriteLine(endpoint.Name); |
This file contains hidden or 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
//define new convention | |
Configure.Conventions.RabbitMq(c => c.ExchangeNameForPubSub((a, t) => a.Queue)); | |
//create the exchanges as needed | |
public class ExchangeInstaller:INeedToInstallSomething<Windows> | |
{ | |
public IManageRabbitMqConnections ConnectionManager { get; set; } | |
public void Install(string identity) | |
{ |
This file contains hidden or 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 NServiceBus; | |
using NServiceBus.MessageMutator; | |
using NServiceBus.ObjectBuilder; | |
public class AddressRewriter:IMutateOutgoingTransportMessages,INeedInitialization | |
{ | |
public void MutateOutgoing(object[] messages, TransportMessage transportMessage) | |
{ | |
transportMessage.ReplyToAddress = LocalAddress; | |
} |
This file contains hidden or 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 NServiceBus; | |
using NServiceBus.Faults; | |
namespace MyServerWithSLR | |
{ | |
using NServiceBus.Faults.Forwarder; | |
public class MyOwnFaultManager : IManageMessageFailures, INeedInitialization | |
{ |
This file contains hidden or 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
<connectionStrings> | |
<add name="NServiceBus.Persistence" connectionString="url=http://localhost.fiddler:8080"/> | |
</connectionStrings> |
This file contains hidden or 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
<system.net> | |
<defaultProxy> | |
<proxy usesystemdefault="False" bypassonlocal="True" proxyaddress="http://127.0.0.1:8888"/> | |
</defaultProxy> | |
</system.net> |