Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Allow a configurable default queue value on push and index requests#18

Open
cjohnson78 wants to merge 2 commits intogoogle-cloudsearch:masterfrom
sadasystems:default-queue-for-push-and-index-items
Open

Allow a configurable default queue value on push and index requests#18
cjohnson78 wants to merge 2 commits intogoogle-cloudsearch:masterfrom
sadasystems:default-queue-for-push-and-index-items

Conversation

@cjohnson78
Copy link
Copy Markdown

api.defaultQueue will set a default queue value on push and index requests if they don't already have a value for queue.

requests if they don't already have a value for queue.
return requestMode == RequestMode.UNSPECIFIED ? this.requestMode.name() : requestMode.name();
}

private String getQueue(String queue) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the method can be static

do we want to check if queue.isEmpty() ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

added check for queue.isEmpty().

I do not see how this could be static, as it depends on this.defaultQueue

}

@Test
public void testUpdateItemWithDefaultQueue() throws GeneralSecurityException, IOException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit, just throw Exception for tests (instead of all named individual exception).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I was just copying existing test cases ; )

@Sdwz
Copy link
Copy Markdown

Sdwz commented Jun 8, 2019

To be honest it feels redundant with traversers configuration

@cjohnson78
Copy link
Copy Markdown
Author

I do not see how it is redundant with Traverser's configuration. I believe you are referring to the setting that allows you to poll a certain queue? This change is for pushing, not polling. It is necessary to work in conjunction with the other setting. If we install multiple Listing connector in the same datasource (like File System + SharePoint) they currently all push to the "default" queue, regardless of what we configure for polling in the traverser settings. If I missed anything else applicable to pushing to different queues, let me know.

@cjohnson78
Copy link
Copy Markdown
Author

Or maybe you just meant we could use the same setting for both? I can think of at least one example where you might want to push to one queue but poll another queue. It is during development when we want to restrict polling activity. We sometimes change the polling queue to a bogus value so that absolutely no polling occurs, even at startup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants