Skip to content

Commit

Permalink
Merge pull request #201 from SoftwareDesignLab/pne-patchfinder-job-st…
Browse files Browse the repository at this point in the history
…reaming

Rabbit queue fixes
  • Loading branch information
ctevse authored Nov 30, 2023
2 parents cdeda01 + 1e0b132 commit ecdb3ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ public static void initializeProductDict(){
final long timeSinceLastFullPull = Duration.between(productDictLastCompilationDate, Instant.now()).getSeconds();
final long timeSinceLastRefresh = Duration.between(productDictLastRefreshDate, Instant.now()).getSeconds();

logger.info("Successfully read {} products from file '{}' ({} day(s) old)",
logger.info("Successfully read {} products from file '{}' ({} day(s) since refresh, {} day(s) since full query)",
productDict.size(),
productDictName,
Math.floor((float) timeSinceLastRefresh / 3600 / 24 * 10) / 10 // seconds -> hours
productDictPath,
Math.floor((float) timeSinceLastRefresh / 3600 / 24 * 10) / 10, // seconds -> hours
Math.floor((float) timeSinceLastFullPull / 3600 / 24 * 10) / 10 // seconds -> hours
);

// Update dictionary as needed
Expand Down
11 changes: 7 additions & 4 deletions productnameextractor/src/main/java/messenger/Messenger.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ public void run() {
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();

// TODO: Needed?
channel.queueDeclare(inputQueue, true, false, false, null);
channel.queueDeclare(patchFinderOutputQueue, true, false, false, null);
channel.queueDeclare(fixFinderOutputQueue, true, false, false, null);
channel.queueDeclareNoWait(inputQueue, true, false, false, null);
channel.queueDeclareNoWait(patchFinderOutputQueue, true, false, false, null);
channel.queueDeclareNoWait(fixFinderOutputQueue, true, false, false, null);
// TODO: Remove when queue issue is resolved (errors thrown likely when producer does not receive info from consumer)
// channel.queueDeclare(inputQueue, true, false, false, null);
// channel.queueDeclare(patchFinderOutputQueue, true, false, false, null);
// channel.queueDeclare(fixFinderOutputQueue, true, false, false, null);

channel.basicConsume(inputQueue, false, new DefaultConsumer(channel) {
@Override
Expand Down

0 comments on commit ecdb3ef

Please sign in to comment.