Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Enrichment
wks
Commits
424fd9fd
Commit
424fd9fd
authored
Sep 09, 2021
by
harshit aggarwal
Browse files
init
parent
1fde2cc1
Pipeline
#64299
failed with stages
in 62 minutes and 7 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
provider/wks-azure/src/main/java/org/opengroup/osdu/wks/provider/azure/pubsub/SubscriptionManagerImpl.java
View file @
424fd9fd
...
...
@@ -12,7 +12,9 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.time.Duration
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
...
...
@@ -35,20 +37,36 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
@Override
public
void
subscribeRecordsChangeEvent
()
{
Set
<
String
>
partitions
=
new
HashSet
<>();
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
Integer
.
parseUnsignedInt
(
azureBootstrapConfig
.
getNThreads
()));
while
(
true
)
{
List
<
String
>
tenantList
=
tenantFactory
.
listTenantInfo
().
stream
().
map
(
TenantInfo:
:
getDataPartitionId
)
.
collect
(
Collectors
.
toList
());
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
Integer
.
parseUnsignedInt
(
azureBootstrapConfig
.
getNThreads
()));
for
(
String
partition
:
tenantList
)
{
if
(
partitions
.
contains
(
partition
))
{
continue
;
}
try
{
SubscriptionClient
subscriptionClient
=
this
.
subscriptionClientFactory
.
getSubscriptionClient
(
partition
);
registerMessageHandler
(
subscriptionClient
,
executorService
);
partitions
.
add
(
partition
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"Error while creating or registering subscription client"
,
e
);
}
}
try
{
Thread
.
sleep
(
600000
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"Execption encountered while sleeping the thread"
,
e
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment