sciurus-cache-redis

This is an implementation of Sciurus' CustomCache for Redis.

Лицензия

Лицензия

Категории

Категории

Redis Данные Базы данных
Группа

Группа

io.mcarle
Идентификатор

Идентификатор

sciurus-cache-redis
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

sciurus-cache-redis
This is an implementation of Sciurus' CustomCache for Redis.
Ссылка на сайт

Ссылка на сайт

https://github.com/mcarleio/sciurus-cache-redis
Система контроля версий

Система контроля версий

https://github.com/mcarleio/sciurus-cache-redis

Скачать sciurus-cache-redis

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.mcarle/sciurus-cache-redis/ -->
<dependency>
    <groupId>io.mcarle</groupId>
    <artifactId>sciurus-cache-redis</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.mcarle/sciurus-cache-redis/
implementation 'io.mcarle:sciurus-cache-redis:1.0.0'
// https://jarcasting.com/artifacts/io.mcarle/sciurus-cache-redis/
implementation ("io.mcarle:sciurus-cache-redis:1.0.0")
'io.mcarle:sciurus-cache-redis:jar:1.0.0'
<dependency org="io.mcarle" name="sciurus-cache-redis" rev="1.0.0">
  <artifact name="sciurus-cache-redis" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.mcarle', module='sciurus-cache-redis', version='1.0.0')
)
libraryDependencies += "io.mcarle" % "sciurus-cache-redis" % "1.0.0"
[io.mcarle/sciurus-cache-redis "1.0.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
io.mcarle : sciurus jar 1.1.0
io.lettuce : lettuce-core jar 5.1.8.RELEASE
org.apache.logging.log4j : log4j-slf4j-impl jar 2.12.1

test (7)

Идентификатор библиотеки Тип Версия
com.google.code.gson : gson jar 2.8.5
org.junit.jupiter : junit-jupiter-engine jar 5.5.1
org.junit.jupiter : junit-jupiter-params jar 5.5.1
org.hamcrest : hamcrest jar 2.1
org.mockito : mockito-core jar 3.0.0
org.mockito : mockito-junit-jupiter jar 3.0.0
org.apache.logging.log4j : log4j-core jar 2.12.1

Модули Проекта

Данный проект не имеет модулей.

Sciurus Cache Redis

This is an implementation of Sciurus' CustomCache for Redis.

Maven Central License Build status Build status Code Quality

General Usage

You need to include Sciurus Cache Redis as dependency and declare Sciurus as an aspect library in the aspectj-maven-plugin:

  1. Include Sciurus Cache Redis as dependency

    <dependency>
        <groupId>io.mcarle</groupId>
        <artifactId>sciurus-cache-redis</artifactId>
        <version>1.0.0</version>
    </dependency>
  2. Include aspectj-maven-plugin and define Sciurus as aspectLibrary

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.11</version>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                    <goal>test-compile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <complianceLevel>${maven.compiler.source}</complianceLevel>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            <aspectLibraries>
                <aspectLibrary>
                    <groupId>io.mcarle</groupId>
                    <artifactId>sciurus</artifactId>
                </aspectLibrary>
            </aspectLibraries>
        </configuration>
    </plugin>

How to use?

First, see the Sciurus project to see how to use Sciurus' cache functionality (you will also find a simple example project there).

To register RedisCache to Sciurus, you simply do

Sciurus.registerCache(
    "<name of your cache>",
    new RedisCache(RedisClient.create("redis://localhost:6379/0"))
);

Further inforamtion

This implementation for storing the cached values in Redis is using Java's serialization mechanism. Therefore, you have to make sure that the classes adhere Java's serialization mechanism!

Hint: Sciurus will catch any exception and then simply executes the original method and return the result. The exception is only logged and your application will more or less work, as if there is no cache enabled.

License

Unless explicitly stated otherwise all files in this repository are licensed under the Apache Software License 2.0

Copyright 2019 Marcel Carlé

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Версии библиотеки

Версия
1.0.0