<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2020 New Relic Corporation. All rights reserved.
SPDX-License-Identifier: Apache-2.0
-->
<extension xmlns="urn:newrelic-extension">
	<instrumentation>
		<tracerFactory name="ReceiveMessageWrapper">
			<match assemblyName="NServiceBus.Core" className="NServiceBus.InvokeHandlersBehavior">
				<exactMethodMatcher methodName="Invoke" parameters="NServiceBus.Pipeline.Contexts.IncomingContext,System.Action" />
			</match>
		</tracerFactory>
		<tracerFactory name="SendMessageWrapper">
			<match assemblyName="NServiceBus.Core" className="NServiceBus.Unicast.UnicastBus">
				<exactMethodMatcher methodName="SendMessage" parameters="NServiceBus.Unicast.SendOptions,NServiceBus.Unicast.Messages.LogicalMessage" />
			</match>
		</tracerFactory>

		<!--NSB 6 and above instrumentation points-->
		<tracerFactory name="LoadHandlersConnectorWrapper">
			<match assemblyName="NServiceBus.Core" className="NServiceBus.LoadHandlersConnector">
				<exactMethodMatcher methodName="Invoke" parameters="NServiceBus.Pipeline.IIncomingLogicalMessageContext,System.Func`2[NServiceBus.Pipeline.IInvokeHandlerContext,System.Threading.Tasks.Task]" />
			</match>
		</tracerFactory>
		<tracerFactory name="PipelineWrapper">
			<match assemblyName="NServiceBus.Core" className="NServiceBus.Pipeline`1">
				<exactMethodMatcher methodName="Invoke" parameters="!0" />
			</match>
		</tracerFactory>
	</instrumentation>
</extension>