[go: nahoru, domu]

Skip to content

Commit

Permalink
minor changes for naming consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
csplinter committed Jun 10, 2020
1 parent fc2dd20 commit a7d43ee
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 30 deletions.
File renamed without changes.
7 changes: 0 additions & 7 deletions deploy/spring-boot/spring-boot-service-configmap.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: spring-data-service
name: spring-boot-service
data:
application.yml: |-
cassandra.contact-points: cluster1-dc1-service.cass-operator
cassandra.contact-points: cluster1-dc1-service.cass-operator
cassandra.keyspace: betterbotz
cassandra.local-datacenter: dc1
cassandra.port: 9042
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions deploy/spring-data/spring-data-service-configmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: spring-data-service
data:
application.yml: |-
spring.data.cassandra.contact-points: cluster1-dc1-service.cass-operator
spring.data.cassandra.port: 9042
spring.data.cassandra.keyspace-name: betterbotz
spring.data.cassandra.local-datacenter: dc1
spring.data.cassandra.schema-action: create-if-not-exists
spring.data.cassandra.rest.basePath: /api
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public DriverConfigLoaderBuilderCustomizer driverConfigLoaderBuilderCustomizer()
return builder -> builder.without(DefaultDriverOption.CONTACT_POINTS);
}
return builder -> builder
.withString(DefaultDriverOption.SESSION_KEYSPACE, this.keyspace);
.withString(DefaultDriverOption.SESSION_NAME, "spring-boot-service");
}

@Bean
Expand Down
7 changes: 3 additions & 4 deletions microservice-spring-boot/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ management:
server:
port: 8084

cassandra.contact-points: host.docker.internal
cassandra.keyspace: betterbotz
cassandra.local-datacenter: datastax-desktop
cassandra.port: 9042
---
spring.profiles: docker
cassandra.contact-points: host.docker.internal
cassandra.keyspace: betterbotz
cassandra.local-datacenter: dc1
cassandra.port: 9042
---
spring.profiles: kubernetes
spring.cloud.kubernetes.enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public class SpringDataCassandraConfiguration extends AbstractCassandraConfigura
@Value("${DB_PASSWORD:cassandra}")
private String password;

@Value("${cassandra.contact-points:localhost}")
private String contactPoints;

@Override
protected String getKeyspaceName() {
return cassandraProperties.getKeyspaceName();
Expand All @@ -55,10 +52,6 @@ protected int getPort() {
return cassandraProperties.getPort();
}

protected String getContactPoints(){
return contactPoints;
}

@Override
protected SessionBuilderConfigurer getSessionBuilderConfigurer() {
return new SessionBuilderConfigurer() {
Expand All @@ -71,14 +64,15 @@ public CqlSessionBuilder configure(CqlSessionBuilder cqlSessionBuilder) {
}
else{
return cqlSessionBuilder
.addContactPoint(new InetSocketAddress(contactPoints, getPort()))
.addContactPoint(new InetSocketAddress(
cassandraProperties.getContactPoints().get(0),
cassandraProperties.getPort()))
.withAuthCredentials(username, password);
}
}
};
}

/** {@inheritDoc} */
@Override
protected List<CreateKeyspaceSpecification> getKeyspaceCreations() {
if (!astraSecureConnectBundle.equals("none")) {
Expand All @@ -90,14 +84,12 @@ protected List<CreateKeyspaceSpecification> getKeyspaceCreations() {
}
return Arrays.asList();
}

/** {@inheritDoc} */

@Override
public SchemaAction getSchemaAction() {
return SchemaAction.CREATE_IF_NOT_EXISTS;
}

/** {@inheritDoc} */

@Override
protected KeyspacePopulator keyspacePopulator() {
ResourceKeyspacePopulator keyspacePopulate = new ResourceKeyspacePopulator();
Expand All @@ -106,7 +98,6 @@ protected KeyspacePopulator keyspacePopulator() {
return keyspacePopulate;
}

/** {@inheritDoc} */
@Override
public String[] getEntityBasePackages() {
return new String[]{ SpringDataApplication.class.getPackageName() + ".model" };
Expand Down
6 changes: 4 additions & 2 deletions microservice-spring-data/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ server.port: 8081

management.server.port: 8082

---
spring.profiles: docker
spring:
data:
cassandra:
port: 9042
contact-points: host.docker.internal
keyspace-name: betterbotz
local-datacenter: localhost
local-datacenter: dc1
schema-action: create-if-not-exists
rest:
basePath: /api

---
spring.profiles: kubernetes
spring.cloud.kubernetes.enabled: true
Expand Down

0 comments on commit a7d43ee

Please sign in to comment.