From 210c5b3f207bc570eed375888cbff17f2d25c284 Mon Sep 17 00:00:00 2001 From: Freddy <147462678+freddyDOTCMS@users.noreply.github.com> Date: Mon, 3 Nov 2025 17:09:06 -0600 Subject: [PATCH] Issue 33718 push publishing performance improvements (#33719) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a Sender sends bundles to a Receiver, it continuously checks the Receiver’s status by sending a separate request for each bundle. This means that if there are N bundles pending to be processed on the Receiver, the Sender sends N individual requests to check their status. With this improvement, we are grouping multiple bundles into a single status request, so instead of sending one request per bundle, the Sender will send one request for a set of bundles at a time. ### Proposed Changes * Cheking bundles b set https://github.com/dotCMS/core/pull/33719/files#diff-3d6a94f7aaa4361170087db426677f8088ba0db2031d9917ec16de3e0b661630R295-R846 * Cheking in the receiver the status in the database by set too https://github.com/dotCMS/core/pull/33719/files#diff-62b24c7fa30114a95721a0b252abc433bef78a9abe5f16cdf5d38c21545e07cfR225-R247 --------- Co-authored-by: Daniel Silva --- .../business/PublishAuditAPIImpl.java | 24 +++++++------------ .../publisher/business/PublisherQueueJob.java | 1 - .../dotcms/rest/AuditPublishingResource.java | 20 ++++------------ 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/dotCMS/src/main/java/com/dotcms/publisher/business/PublishAuditAPIImpl.java b/dotCMS/src/main/java/com/dotcms/publisher/business/PublishAuditAPIImpl.java index 27da9af58f1..ca182f6b165 100644 --- a/dotCMS/src/main/java/com/dotcms/publisher/business/PublishAuditAPIImpl.java +++ b/dotCMS/src/main/java/com/dotcms/publisher/business/PublishAuditAPIImpl.java @@ -225,29 +225,23 @@ public PublishAuditStatus getPublishAuditStatus(String bundleId) @CloseDBIfOpened public List getPublishAuditStatuses(List bundleIds) throws DotPublisherException { - if (bundleIds == null || bundleIds.isEmpty()) { - return Collections.emptyList(); - } try { final List result = new ArrayList<>(); - final DotConnect dc = new DotConnect(); - final String placeholders = bundleIds.stream() - .map(id -> "?") - .collect(Collectors.joining(",")); + DotConnect dc = new DotConnect(); + final List parameter = bundleIds.stream().map(id -> "'" + id + "'").collect(Collectors.toList()); - dc.setSQL(String.format(SELECT_ALL_BY_BUNDLES_IDS, placeholders)); - bundleIds.forEach(dc::addParam); - final List> items = dc.loadObjectResults(); + dc.setSQL(String.format(SELECT_ALL_BY_BUNDLES_IDS, String.join(",", parameter))); + List> items = dc.loadObjectResults(); - for (final Map item : items) { - result.add(turnIntoPublishAuditStatus(NO_LIMIT_ASSETS, item)); + for(Map item: items) { + result.add(turnIntoPublishAuditStatus(NO_LIMIT_ASSETS, item)); } return result; - } catch (Exception e) { - Logger.error(PublishAuditAPIImpl.class, e.getMessage(), e); - throw new DotPublisherException("Unable to get list of elements with error:" + e.getMessage(), e); + }catch(Exception e){ + Logger.debug(PublisherUtil.class,e.getMessage(),e); + throw new DotPublisherException("Unable to get list of elements with error:"+e.getMessage(), e); } } diff --git a/dotCMS/src/main/java/com/dotcms/publisher/business/PublisherQueueJob.java b/dotCMS/src/main/java/com/dotcms/publisher/business/PublisherQueueJob.java index b15ee8984a5..f3c16e79f9d 100644 --- a/dotCMS/src/main/java/com/dotcms/publisher/business/PublisherQueueJob.java +++ b/dotCMS/src/main/java/com/dotcms/publisher/business/PublisherQueueJob.java @@ -654,7 +654,6 @@ private List getRemoteHistoryFromEndpoint(final List bundleIds, - @Context final HttpServletRequest request) { - - final AuthCredentialPushPublishUtil.PushPublishAuthenticationToken ppAuthToken = - AuthCredentialPushPublishUtil.INSTANCE.processAuthHeader(request); - - final Optional failResponse = PushPublishResourceUtil.getFailResponse(request, ppAuthToken); - - if (failResponse.isPresent()) { - return failResponse.get(); - } - + public Response getAll( List bundleIds) { try { final List statuses = auditAPI.getPublishAuditStatuses(bundleIds);