Skip to content

Migration from 6.4.1 to 7.1.0 - removed classes/functions #223

Answered by pawelryznar
pawelryznar asked this question in Q&A
Discussion options

You must be logged in to vote

I changed my code to the following:

import io.github.bucket4j.grid.jcache.JCacheProxyManager

    private val cache: Cache<String, ByteArray> = cacheManager.getCache(rateLimitProperties.cacheName)
    private val buckets = JCacheProxyManager(cache)
.
.
.
val bucket = buckets.builder().build(principal.name, configuration)
val probe = bucket.tryConsumeAndReturnRemaining(1)

and removed key-type and value-type from ehcache.xml:

    <cache alias="rate-limit-buckets">
        <expiry>
            <ttl>3600</ttl>
        </expiry>
        <heap>1000000</heap>
        <jsr107:mbeans enable-statistics="true"/>
    </cache>

It's working now, so I hope it's correct.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@pawelryznar
Comment options

@vladimir-bukhtoyarov
Comment options

Comment options

You must be logged in to vote
1 reply
@vladimir-bukhtoyarov
Comment options

Answer selected by pawelryznar
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