We are getting below error in sitecore 9.0.2 version on cd environment for getting interactions from xdb using xconnect
In connectionstring for CD below entry was there
<add name="xconnect.collection" connectionString="https://qa.collection" /> -
After comment we replaced with entry from cm connection string which is as below
<add name="xconnect.collection" connectionString="https://qa.collectionsearch" />
After replace error is not coming, Can someone tell should CD have only xconnect collection and not search connection string?
Error Log:
The HTTP response was not successful: InternalServerError at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func 1 taskFactory) at Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock[TResult](Func 1 taskFactory) at Sitecore.XConnect.Client.XConnectSynchronousExtensions.GetBatchEnumeratorSync[TEntity](IAsyncQueryable`1 asyncQueryable, Int32 defaultBatchSize) at isango.Foundation.Analytics_JF2.Services.AnalyticsTrackingService.GetFilterInteractionsByMerchandisingAsync(Guid pageEvent, Int32 days, String destinationIdentifier, String categoryIdentifier, String attractionIdentifier, String country, Int32 count)
Code snippet where error is coming:
using (XConnectClient client = Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient())
{
IAsyncQueryable<Interaction> queryable = client.Interactions
.Where(x => x.EndDateTime >= DateTime.UtcNow.AddDays(days) && x.Events.Any(y=>y.DefinitionId == pageEventId && y.Data == categoryto_filter && y.DataKey == country));
var enumerable = queryable.GetBatchEnumeratorSync();
if (enumerable.TotalCount <= 0)
{
queryable = client.Interactions
.Where(x => x.EndDateTime >= DateTime.UtcNow.AddDays(days) && x.Events.Any(y => y.DefinitionId == pageEventId && y.Data == categoryto_filter));
enumerable = queryable.GetBatchEnumeratorSync();
}
}