nservicebus_for_admins
DESCRIPTION
Deck for introduction IT Admins to NSB and what they need to know to support the productTRANSCRIPT
NSERVICEBUS FOR ADMINS
Integration Framework Patterns
2
Broker
Broker
AppApp
App
App
App
Bus
Bus
App
Bus
App
Bus
App
Bus
App
Messaging Patterns
Publish & Subscribe
Subscriptions Publisher
BusSubscriber
Bus
Subscriber
Bus
Subscriber
Bus
Bus
Request & Response
Client
Bus
Response
Request
Distributor
Work Management
Distributor
Bus
Worker
Bus
Worker
Bus
Worker
Saga(Workflow)
StatePersistence
Main Business Process Bus
Sub Process
3
Bus
Sub Process
1 BusSub
Process 2
Site 2Site 1
Gateway
Gateway Gateway
HTTP
ClientServer
Messaging/Integration Framework Selection Criteria• Features
• Publish/Subscribe• Work Distribution• Long Running Business Workflows
• Lives on existing infrastructure• Low Learning Curve• Actively supported• Cost Effective
Selected Framework• NServiceBus
• Open Source• Feature Rich• Built on MSMQ, MSDTC, and .NET
NServiceBus Architecture
Required Software• MSMQ• MSDTC• NSB Bits• .NET Framework 3.5 SP1• RDBMS
• Subscription Storage• Very small, SQL Server will do
Monitoring• PerfMon Counters
• NSB• “Critical Time” – how long has the oldest message been sitting in the
queue
• Logs• SCOM
• MSMQ• Error Queue
Logging• Configurable & managed by the developer• Includes standard mechanisms
• Files• Event Log• Database• Custom…
Installation• NServiceBus.Host.exe
• [/install (installs as a Windows Service)• [/serviceName] (name in the registry)• [/displayName] (display name in Mgr)• [/description] (description in Mgr)• [/instance] (another named instance)• [/startManually] (don’t start the service)• [/username] (account it runs as)• [/password] (password of above user)• [ProfileName] (name of the profile to use)
Profiles• Modifies host behavior on startup
• Logging• Subscription Storage
• Can Create Custom Profiles• OOTB Profiles
• Lite: Console app, verbose logging, memory subscription storage
• Integration: Console app, informational logging, MSMQ subscription storage
• Production: Windows Service, error logging, database subscription storage
Uninstallation• NServiceBus.Host.exe
• [/uninstall• [/serviceName]• [/instance]]
Application Level MSMQ Configuration
• <MsmqTransportConfig• InputQueue="client“
• Queue messages are being received on
• ErrorQueue="error“• Queue error messages are sent to
• NumberOfWorkerThreads="1“• Number of threads used to process messages
• MaxRetries="5“• Max number of times to try and process a message
• />
Subscription Storage Configuration• <MsmqSubscriptionStorageConfig Queue="subscriptions" />
• Queue to look for subscriptions
• <DBSubscriptionStorageConfig>• <NHibernateProperties>
• <add Key="connection.provider" Value="NHibernate.Connection.DriverConnectionProvider"/>
• <add Key="connection.driver_class" Value="NHibernate.Driver.SqlClientDriver"/>
• <add Key="connection.connection_string" Value="Server=.;Database=nservicebussubscriptions;Trusted_Connection=True;"/>
• <add Key="dialect" Value="NHibernate.Dialect.MsSql2005Dialect"/>
• </NHibernateProperties>
• </DBSubscriptionStorageConfig>
Tools• ReturnToSourceQueue.exe
• Replays messages to the queue they came from
• Runner.exe• Validates and fixes MSMQ installations• Starts MSDTC if necessary• Installs NSB performance counters
Running in a Cluster• You need to add the .NET Framework feature or
application server role to the member servers• You need to add both a MSDTC and a MSMQ resource to
the cluster (MSMQ will require that you have MSDTC)• After adding the Generic Application for
NServiceBus.Host.exe, you will need to go in and modify the properties of the generic application to check the "Use Network Name for computer name" box so that NServiceBus points to the cluster name for using MSMQ not to the member server that is currently running it.
Questions?
Pub/Sub Mechanics
Publisher
OutboundSubscriptions
Inbound
Subscriber1
Outbound
Inbound
Subscriber2
Outbound
Inbound
Errors
Inbound
ReturnToSourceQueue.exe