This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Component | |
| @ConfigurationProperties(value = "gateway") | |
| public class GatewayConfig { | |
| private String abcGatewayPingURL; | |
| private String xyzGatewayPingURL; | |
| private double abcGatewayRatio; | |
| private double xyzGatewayRatio; | |
| private Map<PaymentGateway, Server> gatewayURLMap; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ribbon.client.name=payment-gateway | |
| payment-gateway.ribbon.eureka.enabled=false | |
| gateway.abcGatewayPingURL=test-stage.abc.in/ping | |
| gateway.xyzGatewayPingURL=test.xyz.in/ping | |
| #These ratios allows us to favour one gateway over another | |
| gateway.abcGatewayRatio=0.5 | |
| gateway.xyzGatewayRatio=0.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bloomfilter.test; | |
| import bloomfilter.BasicBloomFilter; | |
| import bloomfilter.BloomFilter; | |
| import java.util.Arrays; | |
| import java.util.Random; | |
| public class BloomFilterTest { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bloomfilter; | |
| import bloomfilter.hash.Murmur3; | |
| public class BasicBloomFilter extends AbstractBloomFilter { | |
| public BasicBloomFilter(int size) { | |
| super(size); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bloomfilter; | |
| import java.util.Arrays; | |
| import java.util.BitSet; | |
| public abstract class AbstractBloomFilter implements BloomFilter { | |
| protected BitSet bitSet; | |
| protected int expectedElements = -1; | |
| protected double falsePosProbability = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bloomfilter; | |
| public interface BloomFilter { | |
| void addData(String data); | |
| boolean isPresent(String data); | |
| String getInfo(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Header for your request | |
| */ | |
| header = { 'content-type': 'application/json'}; | |
| /* | |
| Converts the Request to a Obejct. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spring.cache.type=redis | |
| spring.redis.host=<ip-address> | |
| spring.redis.port=<Redis port> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| compile 'org.springframework.boot:spring-boot-starter-data-redis' | |
| compile("org.springframework.boot:spring-boot-starter-cache") | |
| implementation('org.springframework.session:spring-session-data-redis') | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | |
| import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; | |
| @EnableRedisHttpSession | |
| @EnableEurekaClient | |
| @SpringBootApplication | |
| public class UIApplication { |