Skip to content

Bucket4j and infinispan #366

Discussion options

You must be logged in to vote

Hello @git-volver

Can I put another context-initializer element with class="io.github.bucket4j.grid.infinispan.serialization.Bucket4jProtobufContextInitializer"
together the other existing in there?

According to Infinispan documentation it is possible https://infinispan.org/docs/stable/titles/encoding/encoding.html#registering-sci-embedded-caches_marshalling


how to instantiate the map variable?

If you have an instance of org.infinispan.Cache then initialization of finctional map is trivial:

private static ReadWriteMap<String, byte[]> toMap(Cache<String, byte[]> cache) {
        FunctionalMapImpl<String, byte[]> functionalMap = FunctionalMapImpl.create(cache.getAdvancedCache());
    …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by git-volver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants