Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Consume plane setup #283

Open
wants to merge 16 commits into
base: consume-plane
Choose a base branch
from
Open

[WIP] Consume plane setup #283

wants to merge 16 commits into from

Conversation

vnktram
Copy link
Contributor

@vnktram vnktram commented Dec 13, 2021

  • Create consume plane lifecycle manager
  • Consumer setup
  • Fetch, Ack, ModAck endpoints via consume plane
  • Consume plane deployment Consume/deployment #284
  • Integrate consume plane with web pods Consume/web integration #293
  • Consumer update based on registry events/updates.
  • Unit tests. (TBD as part of a dedicated PR)
  • Setup prometheus metrics scraping

internal/consumer/request.go Show resolved Hide resolved
service/consume-plane/consumeplaneserver.go Show resolved Hide resolved
service/consume-plane/service.go Show resolved Hide resolved
service/consume-plane/service.go Show resolved Hide resolved
@vnktram vnktram mentioned this pull request Dec 15, 2021
2 tasks
@vnktram vnktram changed the title Consume plane setup [WIP] Consume plane setup Dec 15, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2021

Codecov Report

Merging #283 (e5f1d1d) into consume-plane (18f2f2f) will decrease coverage by 4.23%.
The diff coverage is 3.44%.

Impacted file tree graph

@@                Coverage Diff                @@
##           consume-plane     #283      +/-   ##
=================================================
- Coverage          45.63%   41.39%   -4.24%     
=================================================
  Files                110      117       +7     
  Lines               5125     5587     +462     
=================================================
- Hits                2339     2313      -26     
- Misses              2611     3105     +494     
+ Partials             175      169       -6     
Flag Coverage Δ
integration 28.28% <10.00%> (-0.92%) ⬇️
unittests 39.09% <2.83%> (-4.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/consumer/consumer.go 0.00% <0.00%> (ø)
internal/consumer/lifecycle.go 0.00% <0.00%> (ø)
internal/consumer/request.go 0.00% <0.00%> (ø)
internal/subscriber/core.go 0.00% <0.00%> (ø)
internal/subscriber/model.go 33.62% <ø> (-1.73%) ⬇️
internal/subscriber/retry/builder.go 0.00% <0.00%> (ø)
internal/subscriber/retry/retrier.go 21.79% <0.00%> (ø)
internal/subscriber/subscriber.go 0.00% <0.00%> (ø)
pkg/messagebroker/config.go 100.00% <ø> (ø)
pkg/messagebroker/models.go 100.00% <ø> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18f2f2f...e5f1d1d. Read the comment docs.

@vnktram vnktram mentioned this pull request Dec 23, 2021
Venkat Ram added 3 commits January 12, 2022 14:46
* Integrate consume plane with web pods

* Remove unused file

* Fix lint issues

* Proto commit
Comment on lines +20 to +21
replicaCount = 1
consumePlaneDeployment = "int.stage.razorpay.in"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no ConsumerPlane entry in stage, perf, func files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix this.

Comment on lines +40 to +47
con := &Consumer{
ctx: ctx,
computedHash: computedHash,
subscriberID: subscriberID,
subscription: subscription,
subscriptionSubscriber: subs,
errChan: make(chan error),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you have not set subCore in the intitiated Consumer Instance?

Comment on lines +80 to +81
modAckReq := subscriber.NewModAckMessage(modAckMsg, modAckMsg.Deadline)
modAckReq = modAckReq.WithContext(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can merge into single statement?
modAckReq := subscriber.NewModAckMessage(modAckMsg, modAckMsg.Deadline).WithContext(ctx)

Comment on lines +239 to +246
return &Consumer{
ctx: m.ctx,
computedHash: hash,
subscriberID: subscriberID,
subscription: sub,
subscriberCore: m.subscriberCore,
subscriptionSubscriber: subscriber,
}, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use NewConsumer func instead to keep the initiation from single point.

parsedReq.Subscription = req.Subscription
if req.AckIds != nil && len(req.AckIds) > 0 {
ackMessages := make([]*subscriber.AckMessage, 0)
parsedReq.AckIDs = req.AckIds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated assignment. Remove from here. Its been handled below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the result of the merge. WIll fix it.

ackMessages = append(ackMessages, ackMessage)
modifyDeadlineMsgIdsWithSecs[ackMessage.MessageID] = req.AckDeadlineSeconds
}
parsedReq.AckIDs = req.AckIds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated assignment. Remove from one place

Comment on lines +130 to +131
func (c *Core) NewOpinionatedSubscriber(ctx context.Context,
subscriberID string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment explaining in brief what is an OpinionatedSubscriber?

@vnktram vnktram added wip Work in progress do-not-merge labels Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants