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

[TH2-1988] separate connections for publishing and subscribing #318

Closed
wants to merge 7 commits into from

Conversation

lumber1000
Copy link
Member

No description provided.

@lumber1000 lumber1000 requested review from OptimumCode and Nikita-Smirnov-Exactpro and removed request for OptimumCode July 3, 2024 07:44
Copy link

github-actions bot commented Jul 3, 2024

Test Results

 31 files   31 suites   5s ⏱️
412 tests 412 ✅ 0 💤 0 ❌
477 runs  477 ✅ 0 💤 0 ❌

Results for commit 6b5c84a.

♻️ This comment has been updated with latest results.

@Nikita-Smirnov-Exactpro Nikita-Smirnov-Exactpro changed the title separate connections for publishing and subscribing [TH2-1988] separate connections for publishing and subscribing Jul 3, 2024
@lumber1000 lumber1000 marked this pull request as ready for review July 4, 2024 12:57
@lumber1000 lumber1000 requested a review from OptimumCode July 4, 2024 13:06
private final Map<PinId, ChannelHolder> channelsByPin = new ConcurrentHashMap<>();
private final AtomicReference<State> connectionIsClosed = new AtomicReference<>(State.OPEN);
private final AtomicReference<State> connectionState = new AtomicReference<>(State.OPEN);

Choose a reason for hiding this comment

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

In this implementation state is shared between to real connection. Maybe instead of correct current Connection Manager, create ConnectionRouter witch delegates publish / subscribe requests to two instance of origin Connection manager.

assertEquals(blockAfter.toLong(), messagesCount - countDown.count)

// unblocks publishers
rabbit.executeInContainerWithLogging("rabbitmqctl", "set_vm_memory_high_watermark", "0.4")

Choose a reason for hiding this comment

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

Should we unlock the publisher in this test?

retryTimeDeviationPercent = 0
)
).use { manager ->
repeat(messagesCount) { index ->

Choose a reason for hiding this comment

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

messagesCount is greater than blockAfter, it means that publisher not blocking in this test because check logic is after this circle

Copy link
Member Author

Choose a reason for hiding this comment

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

We send 3 messages, then block publishers, then send 7 more. Subscribe, receive 3, unblock, receive 7. This allows to ensure that publishers were actually blocked. We can simplify the scenario: just send a few messages, block publishers, try to read messages.

Choose a reason for hiding this comment

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

then send 7 more -> If publisher blocked we could able to publish additional messages

Oleg Smelov added 3 commits July 5, 2024 13:20
@OptimumCode
Copy link
Member

@Nikita-Smirnov-Exactpro @lumber1000 Should we close this PR after #321 is merged?

@lumber1000 lumber1000 closed this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants