Skip to content

Commit a6ab694

Browse files
author
Amit Chauhan
committed
added an option to switch to postgres driver (by default application uses yugabyte smart driver)
1 parent 15d48b6 commit a6ab694

File tree

5 files changed

+109
-54
lines changed

5 files changed

+109
-54
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ To run the application locally, do the following:
7373
-Dsslrootcert=<certificatepath>
7474
```
7575
76+
### Run the application using postgres driver
77+
By default, workload simulator uses "Yugabyte Smart Driver". You can run the App using "Postgres Driver" by passing following flag:
78+
```
79+
-Dspring.profiles.active=pgdriver
80+
```
81+
7682
### Run the application on a YugabyteDB Managed cluster
7783
7884
1. To connect the application to your cluster, ensure that you have downloaded the cluster SSL certificate and your computer is added to the IP allow list. Refer to [Before you begin](https://docs.yugabyte.com//preview/develop/build-apps/cloud-add-ip/).

pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@
4141
<groupId>org.springframework</groupId>
4242
<artifactId>spring-aspects</artifactId>
4343
</dependency>
44-
<!--
4544
<dependency>
4645
<groupId>org.postgresql</groupId>
4746
<artifactId>postgresql</artifactId>
4847
<scope>runtime</scope>
4948
</dependency>
50-
-->
5149
<dependency>
5250
<groupId>com.yugabyte</groupId>
5351
<artifactId>jdbc-yugabytedb</artifactId>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
spring:
2+
workload: ${workload:quikShipWorkload}
3+
application:
4+
name: ${SPRING_APPLICATION_NAME:}
5+
jpa:
6+
open-in-view: false
7+
flyway:
8+
enabled: false
9+
datasource:
10+
hikari:
11+
username: ${dbuser:yugabyte}
12+
password: ${dbpassword:yugabyte}
13+
connection-init-sql: 'set statement_timeout=10000;'
14+
maximumPoolSize: ${max-pool-size:10}
15+
maxLifeTime: ${max-life-time:600000}
16+
jdbc-url: jdbc:postgresql://${node:127.0.0.1}:${port:5433}/${dbname:yugabyte}
17+
driver-class-name: org.postgresql.Driver
18+
#ssl: ${ssl:false}
19+
#sslmode: ${sslmode:disable}
20+
#sslrootcert: ${sslrootcert:~/.ssh/ybcloudcert/root.crt}
21+
22+
data:
23+
cassandra:
24+
local-datacenter: ${datacenter_c:DC1}
25+
port: ${port_c:9042}
26+
contact-points: ${node_c:127.0.0.1}
27+
userid: ${userid_c:cassandra}
28+
password: ${password_c:yugabyte}
29+
sslcertpath: ${sslcertpath_c:NA}
30+
31+
logging.level:
32+
root: ERROR
33+
java.sql: ERROR
34+
com.zaxxer.hikari: TRACE
35+
com.yugabyte: ERROR
36+
com.yugabyte.simulation.workload: ERROR
37+
org.springframework.jdbc.core: ERROR
38+
39+
server:
40+
port: 8080
41+
42+
ybm:
43+
account-id: ${ybm-account-id:NA}
44+
api-key: ${ybm-api-key:NA}
45+
project-id: ${ybm-project-id:NA}
46+
cluster-id: ${ybm-cluster-id:NA}
47+
baseuri: ${ybm-baseuri:https://cloud.yugabyte.com/api/public/v1/accounts}
48+
pulltopologyfromapi: ${pulltopologyfromapi:false}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
spring:
2+
workload: ${workload:quikShipWorkload}
3+
application:
4+
name: ${SPRING_APPLICATION_NAME:}
5+
jpa:
6+
open-in-view: false
7+
flyway:
8+
enabled: false
9+
datasource:
10+
hikari:
11+
username: ${dbuser:yugabyte}
12+
password: ${dbpassword:yugabyte}
13+
connection-init-sql: 'set statement_timeout=10000;'
14+
maximumPoolSize: ${max-pool-size:10}
15+
maxLifeTime: ${max-life-time:600000}
16+
data-source-class-name: com.yugabyte.ysql.YBClusterAwareDataSource
17+
data-source-properties:
18+
serverName: ${node:127.0.0.1}
19+
portNumber: ${port:5433}
20+
databaseName: ${dbname:yugabyte}
21+
topologyKeys: "aws.us-west-2.*"
22+
#additionalEndpoints: 127.0.0.2:5433,127.0.0.3:5433
23+
#ssl: ${ssl:false}
24+
#sslmode: ${sslmode:disable}
25+
#sslrootcert: ${sslrootcert:~/.ssh/ybcloudcert/root.crt}
26+
27+
data:
28+
cassandra:
29+
local-datacenter: ${datacenter_c:DC1}
30+
port: ${port_c:9042}
31+
contact-points: ${node_c:127.0.0.1}
32+
userid: ${userid_c:cassandra}
33+
password: ${password_c:yugabyte}
34+
sslcertpath: ${sslcertpath_c:NA}
35+
36+
logging.level:
37+
root: ERROR
38+
java.sql: ERROR
39+
com.zaxxer.hikari: TRACE
40+
com.yugabyte: ERROR
41+
com.yugabyte.simulation.workload: ERROR
42+
org.springframework.jdbc.core: ERROR
43+
44+
server:
45+
port: 8080
46+
47+
ybm:
48+
account-id: ${ybm-account-id:NA}
49+
api-key: ${ybm-api-key:NA}
50+
project-id: ${ybm-project-id:NA}
51+
cluster-id: ${ybm-cluster-id:NA}
52+
baseuri: ${ybm-baseuri:https://cloud.yugabyte.com/api/public/v1/accounts}
53+
pulltopologyfromapi: ${pulltopologyfromapi:false}
Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,3 @@
11
spring:
2-
workload: ${workload:quikShipWorkload}
3-
application:
4-
name: ${SPRING_APPLICATION_NAME:}
5-
jpa:
6-
open-in-view: false
7-
flyway:
8-
enabled: false
9-
datasource:
10-
hikari:
11-
username: ${dbuser:yugabyte}
12-
password: ${dbpassword:yugabyte}
13-
connection-init-sql: 'set statement_timeout=10000;'
14-
maximumPoolSize: ${max-pool-size:10}
15-
maxLifeTime: ${max-life-time:600000}
16-
data-source-class-name: com.yugabyte.ysql.YBClusterAwareDataSource
17-
data-source-properties:
18-
serverName: ${node:127.0.0.1}
19-
portNumber: ${port:5433}
20-
databaseName: ${dbname:yugabyte}
21-
topologyKeys: "aws.us-west-2.*"
22-
#additionalEndpoints: 127.0.0.2:5433,127.0.0.3:5433
23-
#ssl: ${ssl:false}
24-
#sslmode: ${sslmode:disable}
25-
#sslrootcert: ${sslrootcert:~/.ssh/ybcloudcert/root.crt}
26-
27-
data:
28-
cassandra:
29-
local-datacenter: ${datacenter_c:DC1}
30-
port: ${port_c:9042}
31-
contact-points: ${node_c:127.0.0.1}
32-
userid: ${userid_c:cassandra}
33-
password: ${password_c:yugabyte}
34-
sslcertpath: ${sslcertpath_c:NA}
35-
36-
logging.level:
37-
root: ERROR
38-
java.sql: ERROR
39-
com.zaxxer.hikari: TRACE
40-
com.yugabyte: ERROR
41-
com.yugabyte.simulation.workload: ERROR
42-
org.springframework.jdbc.core: ERROR
43-
44-
server:
45-
port: 8080
46-
47-
ybm:
48-
account-id: ${ybm-account-id:NA}
49-
api-key: ${ybm-api-key:NA}
50-
project-id: ${ybm-project-id:NA}
51-
cluster-id: ${ybm-cluster-id:NA}
52-
baseuri: ${ybm-baseuri:https://cloud.yugabyte.com/api/public/v1/accounts}
53-
pulltopologyfromapi: ${pulltopologyfromapi:false}
2+
profiles:
3+
active: ybdriver

0 commit comments

Comments
 (0)