I am struggling with getting external activation to work with 2 databases from the same server. Up to now, we have just performed external activation from a single database!
Scenario is as follows
DBServer1:
- Database1:
-- Service Broker Service: //DB/ExternalActivation/Service
- Database2:
-- Service Broker Service: //DB/ExternalActivation/Service
In the EAService.config of the Service Broker External Activator I can only reference one of these databases:
<NotificationServiceList><NotificationService name="//DB/ExternalActivation/Service" id="100" enabled="true"><Description>Service Broker external activation notification service</Description><ConnectionString><!-- All connection string parameters except User Id and Password should be specified here --><Unencrypted>server=DBServer1;database=Database1;Application Name=Service Broker External Activator Service;Integrated Security=true;</Unencrypted></ConnectionString></NotificationService></NotificationServiceList>
My event notifications are:
USE Database1 GO CREATE EVENT NOTIFICATION EventNotification_DB1_Target_Queue ON QUEUE Q_DB1_Target FOR QUEUE_ACTIVATION TO SERVICE '//DB/ExternalActivation/Service', 'current database'; GO USE Database2 GO CREATE EVENT NOTIFICATION EventNotification_DB2_Target_Queue ON QUEUE Q_DB2_Target FOR QUEUE_ACTIVATION TO SERVICE '//DB/ExternalActivation/Service', 'current database'; GO
Do I need to look at routing the event notifications away from the services on the local databases and if so is what I am trying to do logically the same approach as 2 separate servers regarding the service broker set up?
It was much more fun when we were doing this using a single database :)