Code Monkey home page Code Monkey logo

beer-service's Introduction

useful endpoints:


/monitoring -JavaMelody

Online tool to generate encripted value for Jasypt

https://www.devglan.com/online-tools/jasypt-online-encryption-decryption

Run the project with the commandline with Jasypt secret instead of adding it to properties file:

mvn-Djasypt.encryptor.password=secretkye spring-boot:run

Don't forget to add this to main application class

@EnableEncryptableProperties

CACHING

@Cacheable

@Cacheable(value = "users", key = "#userId") public User getUser(String userId) { return userRepository.findOne(Long.valueOf(userId)); }

@Cacheable(cacheNames = "myControlledCache", key = "'myControlledPrefix_'.concat(#relevant)") public String getFromCache(String relevant) { return null; }

CACHE EVICT

@CacheEvict(cacheNames = "myControlledCache", key = "'myControlledPrefix_'.concat(#relevant)") public void removeFromCache(String relevant) { }

@CacheEvict(cacheNames = "myControlledCache", allEntries=true) public void removeFromCache(String relevant) { }

@CacheEvict(cacheNames = "myControlledCache"){...}

@CacheEvict(value="addresses", allEntries=true) public String getAddress(Customer customer) {...}

CACHE PUT

@CachePut(cacheNames = "myControlledCache"){...}

@CachePut(cacheNames = "myControlledCache", key = "'myControlledPrefix_'.concat(#relevant)") public String populateCache(String relevant, String unrelevantTrackingId) { return "this is it again!"; }

@CachePut(value="addresses") public String getAddress(Customer customer) {...}

@CacheConfig annotation, you can streamline some of the cache configuration into a single place – at the class level – so that you don't have to declare things multiple times:


@CacheConfig(cacheNames={"addresses"}) public class CustomerDataService {

@Cacheable
public String getAddress(Customer customer) {...}

control the caching based on the output of the method rather than the input – via the unless parameter:


@CachePut(value="addresses", unless="#result.length()<64") public String getAddress(Customer customer) {...}


@Cacheable(value="book", condition="#name.length < 50") public Book findStoryBook (String name)


@CachePut(value="addresses", condition="#customer.name=='Tom'") public String getAddress(Customer customer) {...}

beer-service's People

Watchers

CHRISTIAN (ISHMAEL) GYABAN avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.