.
├── app # Application Source Files.
| ├── SearchApi # Search Api.
| └── DynamicAdapter # Dynamic Adapter.
├── .gitignore # Git ignore.
├── README.md # This file.
├── openshift # Build and Deploy Configurations.
├── test # Integration test resources.
└── bin # Useful scripts.
Create a .env
file from the .env.template
Configure the necessary variables in .env
docker-compose up
app | url |
---|---|
Search API Swagger UI | http://localhost:5050/swagger |
Search API OpenApi Specification | http://localhost:5050/swagger/v1/swagger.json |
Search API Health | http://localhost:5060/health |
Dynamics Adapter Health | http://localhost:5060/health |
Sample Adatpter Health | http://localhost:5052/health |
RabbitMq Management Console | http://localhost:15672/ |
Jaeger OpenTrace Monitoring | http://localhost:16686/search |
HealthChecks UI | http://localhost:6060/healthchecks-ui |
Redis Commander | http://localhost:8081 |
FAMS-search-api is a dotnet core rest service to execute people search accross multiple data providers.
Configure RabbiMq using the following ENV variables:
Property | Required | Description |
---|---|---|
RABBITMQ__HOST | no | RabbitMq Host |
RABBITMQ__PORT | no | RabbitMq Port |
RABBITMQ__USERNAME | no | RabbitMq UserName |
RABBITMQ__PASSWORD | no | RabbitMq Password |
Notes
the variables key have 2 underscores
If the WebHooks section is configured, SearchApi automatically posts a new notification into the webhook collection. The WebHook configuraton in SearchApi is
To enable Person Search notification, configure the SearchApi WebHooks settings.
"SearchApi": {
"WebHooks": [
{
"Name": "dynadapter",
"Uri": "http://localhost:5000/PersonSearch",
}
]
}
With this configuration the searchApi will post Event to http://localhost:5000/PersonSearch/{event}/{id}
where {id} is a global unique identifier for the search request . the content of the payload is dependent on the event.
When the Adapter finds a match for a particular person, it raises an event that post search completed to dynadapter with the result message.
{
"person": {
"firstName": "My name is first",
"lastName": "My name is last",
"dateOfBirth": "0001-01-01T00:00:00"
},
"personIds": [{
"kind": "DriversLicense",
"issuer": "BC Province",
"number": "123123123"
}, {
"kind": "DriversLicense",
"issuer": "AB Province",
"number": "123123123"
}],
"searchRequestId": "00000000-0000-0000-0000-000000000000",
"timeStamp": "0001-01-01T00:00:00",
"providerProfile": {
"name": "Provider"
}
}
When a person Search is accepted by data provider, meaning it has sufficient information to conduct a search. An event is raised and posted to dynadapter.
{
"searchRequestId": "00000000-0000-0000-0000-000000000000",
"timeStamp": "0001-01-01T00:00:00",
"providerProfile": {
"name": "Provider"
}
}
When a person Search does not meet the minimal requirement for the adapter to conduct a search. An event is raised and posted to dynadapter.
{
"reasons": [{
"propertyname": "FirstName",
"errormessage": "firstName is required"
}, {
"propertyname": "LastName",
"errormessage": "LastName is required"
}],
"searchRequestId": "00000000-0000-0000-0000-000000000000",
"timeStamp": "0001-01-01T00:00:00",
"providerProfile": {
"name": "Provider"
}
}
When the adpater throws an unknown exception. An event is raised and posted to dynadapter.
{
"cause": {
"message": "We are unable to proceed"
},
"searchRequestId": "00000000-0000-0000-0000-000000000000",
"timeStamp": "0001-01-01T00:00:00",
"providerProfile": {
"name": "Provider"
}
}
Search Api Post events to the following routes schema host/PersonSearch/{event}/{searchRequestId}.
Event | URL |
---|---|
Completed | host/PersonSearch/Completed/{searchRequestId} |
Accepted | host/PersonSearch/Accepted/{searchRequestId} |
Rejected | host/PersonSearch/Rejected/{searchRequestId} |
Failed | host/PersonSearch/Failed/{searchRequestId} |
The Search Api uses NSwag to autogenerate api specification from the code.
To turn on the swagger Ui, set ASPNETCORE_ENVIRONMENT=Development
environment variable, this should not be use in production
.
The Search Api uses opentracing instrumentation for distributed tracing.
It uses Jaeger implementation to monitor and troubleshoot transactions and reference the jeager-client-csharp.
The csharp client is set up to use configuration via environment.
Notes
Set
JAEGER_SERVICE_NAME
if you want the tracer to ship tracing logs.
SetJAEGER_SAMPLER_TYPE=const
if you want to sample all your traces.
download and install dotnet core 3.0
Optionaly you can configure jaeger
client to send traces:
Run
cd app/SearchApi/SearchApi.Web
dotnet run
Application health can be checked here.
FAMS-search-api is a dotnet core rest service to execute people search accross multiple data providers.
The Search Adpaters a worker that execute a search for a specific data providers.
Property | Required | Description |
---|---|---|
RABBITMQ__HOST | no | RabbitMq Host |
RABBITMQ__PORT | no | RabbitMq Port |
RABBITMQ__USERNAME | no | RabbitMq UserName |
RABBITMQ__PASSWORD | no | RabbitMq Password |
FAMS-dynamic-adapter is a dotnet core rest service that polls dynamics to retrieve ready to search request and execute search using the Search API.
Property | Required | Description |
---|---|---|
RABBITMQ__HOST | no | RabbitMq Host |
RABBITMQ__PORT | no | RabbitMq Port |
RABBITMQ__USERNAME | no | RabbitMq UserName |
RABBITMQ__PASSWORD | no | RabbitMq Password |
SCHEDULER__CRON | no | a dotnet Quartz cron expression |
SEARCHAPI__BASEURL | yes | the base path of the search api |
OAUTH__RESOURCEURL | yes | the resource URL you required the token for |
OAUTH__CLIENTID | yes | the Oauth Client id |
OAUTH__SECRET | yes | the Oauth secret |
OAUTH__OAUTHURL | yes | the Oauth URL |
OAUTH__USERNAME | yes | the Oauth username |
OAUTH__PASSWORD | yes | the Oauth password |
Notes
the variables key have 2 underscores
The Dynamic Adapter uses opentracing instrumentation for distributed tracing.
It uses Jaeger implementation to monitor and troubleshoot transactions and reference the jeager-client-csharp.
The csharp client is set up to use configuration via environment.
Notes
Set
JAEGER_SERVICE_NAME
if you want the tracer to ship tracing logs.
SetJAEGER_SAMPLER_TYPE=const
if you want to sample all your traces.
download and install dotnet core 3.0
Optionaly you can configure jaeger
client to send traces:
Run
cd app/DynamicAdapter/DynamicAdapter.Web
dotnet run
All dotnet core applications support AspNetCore Diagnostics and are compatible with HealthCheck UI
Look at the HealthCheck UI docker image for deployment and configure it using environment variables.
You can find a configuration exemple in our docker-compose.yml under watchdog.
The Adapters for data providers will be created in a private repository and would require interaction with search api core library. The Library has been refactored so that it can be injected into with minimal line of code.
To implement the library, Adatpers should include
using SearchApi.Core.DependencyInjection;
To register the messaging services for search api, see sample below (C#)
services.AddProvider(Configuration, (provider) => new SearchRequestConsumer(provider.GetRequiredService<IValidator<Person>>(),
provider.GetRequiredService<IOptions<ProviderProfileOptions>>(),
provider.GetRequiredService<ILogger<SearchRequestConsumer>>()));