How I can make APM also to catch Exceptions then? I want APM to catch exception before ABP does that. I guess APM proxies exception further
Please do these steps as well
I am not able to get Exceptions to be recorded by Elastic APM. It seems like Exception are handled by some other middleware and not released to Elastic middleware. I placed Use Elastic APM on the top of OnApplicationInitialization. That did not help. So far it seems only exceptions on EF core are caught by Elastic APM. I tested with general Exception thrown by me - even that Exception is not caught
Sure,
Controller
[HttpGet]
[Route("by-dateTime/{utcDateTime}")]
public async Task<RecordDto> GetRecordByDateTime(DateTime utcDateTime)
{
return await _recordAppService.GetRecordByDateTime(utcDateTime);
}
Application service
public async Task<RecordDto> GetRecordByDateTime([DisableDateTimeNormalization] DateTime utcDateTime)
{
var record = await _recordRepository.GetAsync(i => i.UtcDateTime == utcDateTime);
return await ObjectMapper.Map<RecordDto>(record);
}
Microservice A gets call of url path /api/records/by-dateTime/27/12/2021 10:00:00
. The format of date time is default format in InvariantCulture used by HttpClient.
But the issue relates not only to DateTime. It relates to any object which has special symbols in string presentation. For example, if we replace DateTime with string parameter, which value has space symbol inside, then we get problem again, because space can not be used without encoding in url path.
Hi
I have issue with GET endpoint which accepts DateTime as parameter. I have microservices 2 A and B. The endpoint is implemented by A and called by B. For calling I use dynamic HttpApiClient. When DateTime passed to http client as parameter, the DateTime is stringified to string with ToString method. Then the string passed to url parameters pasrt without encoded to url format. That leads, when DaeTime stringified to 'dd/MM/yy hh:mm:ss' format, endpoint is not found because dd MM and yy are parsed as segments of url path.
Is that a bug in http client? I checked ClientProxyUrlBuilder and I think that it should use HttpUtility.UrlEncode for every passed value.ToString() - snippet
Some details and rephrasing... The job is placed in application level of module A. The job uses app service from module B. In monotlith, app service interface is resolved to app service, which provided by B. If service has auth protection then job gets error. I would like to apply some workaround... implement internal version of service in B, which will not be exposed to controllers. Internal service implements the same interface (eg IBookAppService). Then, I would like internal version of service injected in monolith deployment. But in microservices deployment client proxy should be injected
Thus, we have 3 implementations of app service interface
@gterdem Thank yor for reply. But my question is about how to make Background Worker of module A to pull data from module B in way that will work in monolith and microservice deployments
Hi,
We are developing systems which consists of several Modules. We faced with some troubles in managing of communication between them. Right now, we have only monolith deployment. That means all our Modules are referenced by single ABP Host Application (which generated by ABP Suite). We referenced all Modules accordingly architecure of layers
Application -> Application Contracts -> Contracts ...
in Host Application. We have Module A which needs to coomunicate with Module B.
Actually both ways work. The reasl reason is ABP comes with not default languages included into supported cultures. You need to add them into AbpLocalization yourself