Closed theonly1me closed 2 years ago
Hello @theonly1me,
[INFO] +- com.sap.cloud.sdk.cloudplatform:scp-cf:jar:3.39.1-M3:compile
3.39.1-M3
of SAP Cloud SDK?
(There is no SAP Cloud Connector (SCC) connected to your subaccount. Requested opening of a tunnel for subaccount "cca25baa-98cd-443d-990d-2302a0f0892a" and SCC location ID, with default value, that is empty string or simply not configured. Check the configuration on SCC and cloud side.)
Do you have a Cloud Connector attached to your Consumer subaccount..? "cca25baa-98cd-443d-990d-2302a0f0892a"
Why do you have a custom "Serializable" implementation of ThreadContext
called CurrentThreadContext
?
Kind regards Alexander
Hello @newtork, Please find my responses below.
- Why are you using out-dated version
3.39.1-M3
of SAP Cloud SDK?
We will update it to a newer version. But I believe it might not be the reason for the issue as we are able to make the s4 call from our Producer that runs with the correct ThreadContext
(There is no SAP Cloud Connector (SCC) connected to your subaccount. Requested opening of a tunnel for subaccount "cca25baa-98cd-443d-990d-2302a0f0892a" and SCC location ID, with default value, that is empty string or simply not configured. Check the configuration on SCC and cloud side.)
- Do you have a Cloud Connector attached to your Consumer subaccount..? "cca25baa-98cd-443d-990d-2302a0f0892a"
Yes a cloud connector is attached to our subaccount. Both the producer and consumer are present on the same repository and are within the same sub account. However, we are able to successfully make the S4 call from the Producer but not the Consumer. And we think that the reason for this is since it works on a pub-sub model, we're not having the right context on the consumer to make the S4 call to an on-premise system. The consumer is for some reason unable to pick up the cloud connector that is attached.
- Why do you have a custom "Serializable" implementation of
ThreadContext
calledCurrentThreadContext
?
That is because we are trying to capture the current thread context via the ThreadContextAccessor.getCurrentThreadContext()
and send it into the queue so that we can retrieve the threadContext ad the consumer side and execute our S4 call via the ThreadExecutor with the CurrentThreadContext (valid thread context for the S4 call to be successful) on the Consumer side.
Is there a better way of retaining the ThreadContext between the Producer and Consumer?
Thanks, Atchyut
Closing issue because of duplicate entry in internal repository.
Issue Description
We're trying to call an S4 On Prem destination via a CAP consumer (https://pages.github.tools.sap/cap/docs/java/messaging-foundation#receiving) or even a JMS MessagingQueue Listener. Here's the error that we're facing while trying to make the S4 call from the Consumer (it works from the producer since that has the original Request and Thread context):
Important information:
Your code https://github.tools.sap/AssetPerformanceManagement/assetbase/blob/test/cap-notif/maintenancenotification-srv/src/main/java/com/sap/iam/apm/assetbase/consumer/NotificationConsumer.java#L53-L59
Expected outcome S4 Call should happen and return either a Success or Error message
Actual outcome S4 Call fails with 503 and below error when trying from the Consumer possibly due to ThreadContext not being available
Steps attempted to resolve the issue We've tried using TenantAccessor, AuthAccessor, and RequestAccessor, currently trying to use the ThreadContextAccessor and Executor, however, we'll need to pass in the current context form Producer to Consumer by serializing it and deserializing it.
Is there any other way we can retain the Thread context between Producer and Consumer?
Impact / Priority
High Priority
Affected development phase & CC Phase.
Impact: Blocked
Timeline: Immediate (Release in 4 weeks)
Error Message
Here is the Stack Trace:
Maven Dependency Tree
Project Details
Repository:
https://github.tools.sap/AssetPerformanceManagement/assetbase/tree/test/cap-notif
Checklist