Skip to content

Commit

Permalink
Implemented logic to load OpenAPI validator spec at app load to impro…
Browse files Browse the repository at this point in the history
…ve latency issue

1. Implemented logic to load OpenAPI validator spec at app load to improve latency issue
2. Removed unused import from some files
3. Added /status routs to debug version of app deployed
4. Added log for OpenAPI validator failure
5. Added log for layer2 config message
6. Added action in latency logs
  • Loading branch information
Abhishek Y committed Jun 14, 2024
1 parent adaa914 commit d2df7ea
Show file tree
Hide file tree
Showing 21 changed files with 358 additions and 238 deletions.
33 changes: 19 additions & 14 deletions config/config-sample-client-localhost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://127.0.0.1:27017/protocolserver-v2-response-cache"

#webhook:
# url: "https://beckn.free.beeceptor.com/clientURL"
#messageQueue:

#messageQueue:
# amqpURL: "amqp://guest:guest@localhost:5672"
# incomingQueue: "protocol-server-incoming"
# outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,25 +49,24 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
ttl: "PT10S"
select:
ttl : "PT10S"
ttl: "PT10S"
confirm:
ttl : "PT10S"
ttl: "PT10S"
status:
ttl: "PT10S"
get_cancellation_reasons:
ttl: "PT10S"
get_rating_categories:
ttl: "PT10S"


responses:

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"
on_select:
Expand All @@ -80,20 +79,20 @@ app:
ttl: "PT10S"
rating_categories:
ttl: "PT10S"

# Mandatory.
privateKey: "private key"
publicKey: "public key"

# Mandatory.
subscriberId: "dev.bap.faiz.protocol-server.com.dsep:jobs.BAP"
subscriberUri: "https://410e-45-248-79-20.ngrok.io/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: false
uniqueKey: "dev.bap.faiz.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -111,3 +110,9 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useLayer2Config: false
mandateLayer2Config: false

openAPIValidator:
cachedFileLimit: 5
34 changes: 20 additions & 14 deletions config/config-sample-network-localhost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://127.0.0.1:27017/protocolserver-v2-response-cache"

#webhook:
# url: "https://beckn.free.beeceptor.com/clientURL"
#messageQueue:

#messageQueue:
# amqpURL: "amqp://guest:guest@localhost:5672"
# incomingQueue: "protocol-server-incoming"
# outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,24 +49,24 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
ttl: "PT10S"
select:
ttl : "PT10S"
ttl: "PT10S"
confirm:
ttl : "PT10S"
ttl: "PT10S"
status:
ttl : "PT10S"
ttl: "PT10S"
get_cancellation_reasons:
ttl: "PT10S"
get_rating_categories:
ttl: "PT10S"
responses:

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"
on_select:
Expand All @@ -79,20 +79,20 @@ app:
ttl: "PT10S"
rating_categories:
ttl: "PT10S"

# Mandatory.
privateKey: "private key"
publicKey: "public key"

# Mandatory.
subscriberId: "dev.bap.faiz.protocol-server.com.dsep:jobs.BAP"
subscriberUri: "https://410e-45-248-79-20.ngrok.io/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: true
uniqueKey: "dev.bap.faiz.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -110,3 +110,9 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useLayer2Config: false
mandateLayer2Config: false

openAPIValidator:
cachedFileLimit: 5
28 changes: 17 additions & 11 deletions config/config-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://tvast:password@localhost:27017/protocol_server-v2?authSource=admin"

webhook:
url: "https://beckn.free.beeceptor.com/clientURL"
messageQueue:

messageQueue:
amqpURL: "amqp://guest:guest@localhost:5672"
incomingQueue: "protocol-server-incoming"
outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,30 +49,30 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
responses:
ttl: "PT10S"

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"

# Mandatory.
privateKey: "your private key"
publicKey: "your public key"

# Mandatory.
subscriberId: "dev.bap.protocol-server.com"
subscriberUri: "https://ayush.free.beeceptor.com/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: true
uniqueKey: "dev.bap.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -90,3 +90,9 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useLayer2Config: false
mandateLayer2Config: false

openAPIValidator:
cachedFileLimit: 5
28 changes: 17 additions & 11 deletions config/new-config-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://tvast:password@localhost:27017/protocol_server-v2?authSource=admin"

webhook:
url: "https://beckn.free.beeceptor.com/clientURL"
messageQueue:

messageQueue:
amqpUrl: "amqp://guest:guest@localhost:5672"
request-queue: "bap-protocol-server"
response-queue: "bap-protocol-client"
Expand All @@ -50,30 +50,30 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
responses:
ttl: "PT10S"

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"

# Mandatory.
privateKey: "your private key"
publicKey: "your public key"

# Mandatory.
subscriberId: "dev.bap.protocol-server.com"
subscriberUri: "https://ayush.free.beeceptor.com/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: true
uniqueKey: "dev.bap.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -91,3 +91,9 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useLayer2Config: false
mandateLayer2Config: false

openAPIValidator:
cachedFileLimit: 5
46 changes: 26 additions & 20 deletions config/samples/bap-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://MONGO_USERNAME:MONGO_PASSWORD@MONOG_URL:27017/MONGO_DB_NAME?authSource=admin"

#webhook:
# url: "https://beckn.free.beeceptor.com/clientURL"
#messageQueue:

#messageQueue:
# amqpURL: "amqp://guest:guest@localhost:5672"
# incomingQueue: "protocol-server-incoming"
# outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,33 +49,33 @@ app:
actions:
requests:
search:
ttl : "PT15S"
ttl: "PT15S"
init:
ttl : "PT10S"
ttl: "PT10S"
select:
ttl : "PT10S"
ttl: "PT10S"
confirm:
ttl : "PT10S"
ttl: "PT10S"
status:
ttl : "PT10S"
ttl: "PT10S"
track:
ttl : "PT10S"
ttl: "PT10S"
cancel:
ttl : "PT10S"
ttl: "PT10S"
update:
ttl : "PT10S"
ttl: "PT10S"
rating:
ttl : "PT10S"
ttl: "PT10S"
support:
ttl : "PT10S"
ttl: "PT10S"
get_cancellation_reasons:
ttl : "PT10S"
ttl: "PT10S"
get_rating_categories:
ttl : "PT10S"
ttl: "PT10S"
cancellation:
ttl : "PT10S"
ttl: "PT10S"

responses:
responses:
on_search:
ttl: "PT15S"
on_init:
Expand All @@ -99,8 +99,8 @@ app:
cancellation_reasons:
ttl: "PT10S"
rating_categories:
ttl: "PT10S"
ttl: "PT10S"

# Mandatory.
privateKey: "PRIVATE_KEY"
publicKey: "PUBLIC_KEY"
Expand All @@ -113,7 +113,7 @@ app:
registryUrl: REGISTRY_URL
auth: false
uniqueKey: "BAP_SUBSCRIBER_ID_KEY"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -131,3 +131,9 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useLayer2Config: false
mandateLayer2Config: false

openAPIValidator:
cachedFileLimit: 5
Loading

0 comments on commit d2df7ea

Please sign in to comment.