Skip to content

Commit

Permalink
print invalid configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Dec 10, 2024
1 parent 43e84e1 commit 293211a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public void mergeWith(QueueConfiguration overrides) {
this.queueType = overrides.getQueueType();
}
}

@Override
public String toString() {
return "DefaultQueueConfiguration{queueName='%s', queueType='%s'}".formatted(queueName, queueType);
}
}

@JsonInclude
Expand Down Expand Up @@ -118,6 +123,12 @@ public void mergeWith(ConsumerQueueConfiguration overrides) {
this.waitingTime = overrides.getWaitingTime();
}
}

@Override
public String toString() {
return "DefaultConsumerQueueConfiguration{queueName='%s', queueType='%s', maxMessages=%d, waitingTime=%s}"
.formatted(getQueueName(), getQueueType(), maxMessages, waitingTime);
}
}

private final String name;
Expand Down Expand Up @@ -337,4 +348,10 @@ public JobConfiguration mergeWith(JobConfiguration overrides) {

return this;
}

@Override
public String toString() {
return "DefaultJobConfiguration{name='%s', enabled=%s, concurrency=%d, leaderOnly=%s, followerOnly=%s, cron='%s', fixedDelay=%s, initialDelay=%s, fixedRate=%s, scheduler='%s', fork=%d, consumer=%s, producer=%s}"
.formatted(name, enabled, concurrency, leaderOnly, followerOnly, cron, fixedDelay, initialDelay, fixedRate, scheduler, fork, consumer, producer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private ScheduledFuture<?> doSchedule(Job job, JobConfiguration configuration, T
return taskScheduler.schedule(initialDelay, job);
}

throw new JobConfigurationException(job, "Failed to schedule job " + configuration.getName() + " declared in " + job.getSource() + ". Invalid definition");
throw new JobConfigurationException(job, "Failed to schedule job " + configuration.getName() + " declared in " + job.getSource() + ". Invalid definition: " + configuration);
}

private TaskScheduler getTaskScheduler(com.agorapulse.worker.Job job) {
Expand Down

0 comments on commit 293211a

Please sign in to comment.