Need an alternative for JCR lockmanager - jcr

We were using the JCR Lockmanager. But while using we got an exception that it has been deprecated. Issue -> https://issues.apache.org/jira/browse/OAK-6421?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
What can be a suitable alternative to JCR lockmanager ?

Related

Custom SpanAdjuster is not working in Sleuth 1.3.X

I'm using Sleuth 1.3.X to add distributed tracing feature to a microservice, I'm trying to change the Span name, and I came across this Link
It says that the SpanReporter should inject the SpanAdjuster and allow span manipulation before the actual reporting is done.
How I can do that?
here is my SpanAdjuster
#Bean
SpanAdjuster mySpanAdjuster(){
return (SpanAdjuster) span -> {
if ("/rest/XYZ/message".equals(span.tags().get("http.path"))){
Span.builder().from(span).name("Rest API").build();
}
return span;
};
}
You seems to be doing this as the docs suggests, check out the Sleuth auto-configuration, it should be injected, it might happen that you are using an incompatible version of another module/project, e.g.: Spring Boot.
Also, we are about to release Sleuth 3.1.0, you are two major versions behind, this version is not supported anymore, so even if this is a bug, there won't be a new release from the 1.x line that could fix this.

Notifying an instance as down using a ServiceCache in Curator

The documentation for Curator (http://curator.apache.org/curator-x-discovery/index.html) says:
If a particular instance has an I/O error, etc. you should call ServiceProvider.noteError() passing in the instance.
I am using a ServiceCache to get my instances, rather than a ServiceProvider (see Using selection strategies with a cache in Curator).
Where can I find the noteError() method here? I can't find it on the cache object
There is no noteError() on a ServiceCache, however as #Randgalt notes (https://stackoverflow.com/a/57059811/2048051) the best way is to not use a ServiceCache but rather just use ServiceProvider, because in the background that uses a cache anyway, and it has the noteError() method available.
https://issues.apache.org/jira/browse/CURATOR-531 has been raised to make the documentation clearer

Incosistent Results in neo4j-ogm - Related to Session Scope?

We developing a Spring Boot REST Application using Spring Data Neo4J. Recently we upgraded to Spring Data Neo4j 4.2 along with ogm 2.1.1 and using the embedded driver.
In our application we provide some GET operations in which we build some object structures from nodes fetched from Neo4j.
As soon as we are processing multiple requests in parallel, we are facing inconsitent results, i.e., our object structures have a different size on each request.
We are not really sure about the reasons for this inconsistent behavior - but probably it is related to the session handling in OGM? We know that Sessions are not thread safe, but we have no idea how to deal with this issue in SD 4.2. Before 4.2 we changed the sesssion scope to prototype when defining the session bean, but the configuration changed in SD 4.2
Configuration before 4.2
#Bean
#Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Session getSession() throws Exception {
return;
}
We could narrow the source of our problems to the place where we are loading elements from Neo4j via a Repository class:
repository.findOne(id,-1);
If we place this call in a synchronized block, no inconsistencies occur.
synchronized (this) {
repository.findOne(id,-1);
}
We are probably missing some important point using SD 4.2/ogm, but could not find any useful information in the documentation, and on the web.
Is it still possible/necessary to change the sesssion scope in SD 4.2?
This is a bug in the OGM. See: https://jira.spring.io/browse/DATAGRAPH-951
We hope to have a fix for this in the next version (OGM 2.1.2).

advice handler on aws outbound channel adapter

In the past I have been able to apply advice chain handlers on different outbound channel adapters. I am trying to do the same on int-aws:s3-outbound-channel-adapter but its not allowing that. Does this component not allows this behavior. Basically I am interested in finding out when the adapter completes the upload of a file to S3.
<int-aws:s3-outbound-channel-adapter
id="s3-outbound" channel="files" bucket="${s3.bucket}"
multipart-upload-threshold="5192" remote-directory="${s3.remote.dir}"
accessKey="${accessKey}" secretKey="${secretKey}">
THIS DOESNT WORKS - throws an error !!!
<int:request-handler-advice-chain>
</int:request-handler-advice-chain>
</int-aws:s3-outbound-channel-adapter>
Right, that isn't allowed by the XSD. Feel free to raise a JIRA on the matter.
But that doesn't matter that it doesn't work at all.
If you are on Spring Integration 4.x already you can move that <int-aws:s3-outbound-channel-adapter> to the Java & Annotation configuration using #Bean and #ServiceActivator for the AmazonS3MessageHandler.
Where #ServiceActivator has adviceChain attribute to specify bean references to your Advices.
... or you can do that using generic <int:outbound-channel-adapter> and specify AmazonS3MessageHandler as raw <bean> for the ref of the first one.
HTH

Accessing exception from different exception strategy types in Mule

When using catch-exception-strategy in mule, I can access the exception via MEL using #[exception], but this doesn't work for default-exception-strategy. Instead I have to use #[payload.getException()]. Is this the correct behavior? And why is this?
Hi one solution is you can set your catch exception strategy as default exception strategy defined it globally. This is strange actually but you can go ahead with this solution.