Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Indexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Indexer
Commits
56b2d043
Commit
56b2d043
authored
1 year ago
by
Zhibin Mai
Browse files
Options
Downloads
Patches
Plain Diff
Make sure that the indexing message sent to Azure service bus is not over-size
parent
5ee4c7b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!597
Make sure that the indexing message sent to Azure service bus is not over-size
Pipeline
#204222
failed
1 year ago
Stage: build
Stage: scan
Changes
1
Pipelines
9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java
+19
-5
19 additions, 5 deletions
...osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java
with
19 additions
and
5 deletions
provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java
+
19
−
5
View file @
56b2d043
...
...
@@ -81,32 +81,46 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder {
@Override
public
void
createWorkerTask
(
String
payload
,
DpsHeaders
headers
)
{
createTask
(
payload
,
headers
);
create
Worker
Task
s
(
payload
,
headers
);
}
@Override
public
void
createWorkerTask
(
String
payload
,
Long
countdownMillis
,
DpsHeaders
headers
)
{
headers
.
addCorrelationIdIfMissing
();
createTask
(
payload
,
headers
);
createWorkerTasks
(
payload
,
headers
);
}
@Override
public
void
createReIndexTask
(
String
payload
,
DpsHeaders
headers
)
{
headers
.
addCorrelationIdIfMissing
();
publishAllRecordsToServiceBus
(
payload
,
headers
);
}
@Override
public
void
createReIndexTask
(
String
payload
,
Long
countdownMillis
,
DpsHeaders
headers
)
{
headers
.
addCorrelationIdIfMissing
();
publishAllRecordsToServiceBus
(
payload
,
headers
);
}
private
void
createWorkerTasks
(
String
payload
,
DpsHeaders
headers
)
{
headers
.
addCorrelationIdIfMissing
();
Gson
gson
=
new
Gson
();
RecordChangedMessages
receivedPayload
=
gson
.
fromJson
(
payload
,
RecordChangedMessages
.
class
);
List
<
RecordInfo
>
recordInfos
=
parseRecordsAsJSON
(
receivedPayload
.
getData
());
Map
<
String
,
String
>
attributes
=
receivedPayload
.
getAttributes
();
List
<
List
<
RecordInfo
>>
batch
=
Lists
.
partition
(
recordInfos
,
publisherConfig
.
getPubSubBatchSize
());
for
(
List
<
RecordInfo
>
recordsBatch
:
batch
)
{
RecordChangedMessages
recordChangedMessages
=
RecordChangedMessages
.
builder
().
data
(
gson
.
toJson
(
recordsBatch
)).
attributes
(
attributes
).
build
();
String
recordChangedMessagePayload
=
gson
.
toJson
(
recordChangedMessages
);
createTask
(
recordChangedMessagePayload
,
headers
);
}
}
private
void
publishAllRecordsToServiceBus
(
String
payload
,
DpsHeaders
headers
)
{
// fetch all the remaining records
// This logic is temporary and would be updated to call the storage service async.
// Currently, the storage client can't be called out of request scope hence making the
// storage calls sync here
headers
.
addCorrelationIdIfMissing
();
Gson
gson
=
new
Gson
();
RecordReindexRequest
recordReindexRequest
=
gson
.
fromJson
(
payload
,
RecordReindexRequest
.
class
);
final
String
recordKind
=
recordReindexRequest
.
getKind
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment