@Bean public DataSource dataSource() { return connectionFactory().dataSource(); }
@Bean @ConditionalOnProperty(prefix = FeaturesProperties.FEATURES_PREFIX, name = FeaturesProperties.ANALYTICS_ENABLED, matchIfMissing = true) public RedisConnectionFactory scdfRedisConnectionFactory() { return connectionFactory().redisConnectionFactory(); }
@Bean GraphDatabaseService graphDatabaseService() { return connectionFactory().service(GraphDatabaseService.class); } }
@Bean public MongoDbFactory mongoDbFactory() { return connectionFactory().mongoDbFactory(); }
@Bean public ConnectionFactory rabbitConnectionFactory() { return connectionFactory().rabbitConnectionFactory(); } }
@Bean(name = "my-service") public Cluster testClusterFactory() { return connectionFactory().cluster("my-service"); } }
@Bean(name="my-service") public MongoDbFactory testMongoDbFactory() { return connectionFactory().mongoDbFactory(); } }
@Bean(name="my-service") public ConnectionFactory testRabbitConnectionFactory() { return connectionFactory().rabbitConnectionFactory(); } }
@Bean(name = "my-service") public Cluster testClusterFactory() { return connectionFactory().cluster(); } }
@Bean(name="my-service") public DataSource testDatasource() { return connectionFactory().dataSource(); } }
@Bean @ConditionalOnProperty(prefix = FeaturesProperties.FEATURES_PREFIX, name = FeaturesProperties.ANALYTICS_ENABLED, matchIfMissing = true) public RedisConnectionFactory redisFactory() { return connectionFactory().redisConnectionFactory(); }
@Bean public BisConnection bisConnection() { try { LOG.info("Bis-service-connector: using CloudConfiguration"); return connectionFactory().service(BisConnection.class); } catch (CloudException ex) { LOG.warn("Could not bind to BIS service: {}", ex.getMessage()); LOG.debug("Binding to BIS service failed with exception: ", ex); } return new BisConnection(); } }
@Bean(name="my-service") public MongoDbFactory testMongoDbFactory() { return connectionFactory().mongoDbFactory("my-service"); } }
@Bean(name="my-service") public ConnectionFactory testRabbitConnectionFactory() { return connectionFactory().rabbitConnectionFactory("my-service"); } }
@Bean(name = "my-service") public Cluster testClusterFactoryWithConfig() { CassandraClusterConfig config = new CassandraClusterConfig(); SocketOptions socketOptions = new SocketOptions(); socketOptions.setSendBufferSize(12345); config.setSocketOptions(socketOptions); return connectionFactory().cluster("my-service", config); } }
@Bean(name="my-service") public DataSource testDatasource() { return connectionFactory().dataSource("my-service"); } }
@Bean public RedisConnectionFactory redisConnection() { return connectionFactory().redisConnectionFactory(); }
@Bean(name="my-service") public Object testService() { return connectionFactory().service(); } }
@Bean public MongoDbFactory connectionPerHost50_MaxWait200_WriteConcernUnspecified() { MongoDbFactoryConfig serviceConfig = new MongoDbFactoryConfig(null, 50, 200); return connectionFactory().mongoDbFactory("my-service", serviceConfig); }
@Bean public ConnectionFactory connectionFactoryWithConfigAndProperties() { Map<String, Object> properties = new HashMap<>(); properties.put("requestedHeartbeat", 15); properties.put("connectionTimeout", 20); properties.put("connectionLimit", 10); properties.put("publisherConfirms", true); RabbitConnectionFactoryConfig serviceConfig = new RabbitConnectionFactoryConfig(properties, 300); return connectionFactory().rabbitConnectionFactory("my-service", serviceConfig); } }