@SuppressWarnings("removal") // TODO: Remove on Vespa 9
        private CreateVisitorMessage createMessage(VisitorIterator.BucketProgress bucket) {
            CreateVisitorMessage msg = new CreateVisitorMessage(
                    params.getVisitorLibrary(),
                    getNextVisitorId(),
                    receiver.getConnectionSpec(),
                    dataDestination);

            msg.getTrace().setLevel(params.getTraceLevel());
            msg.setTimeRemaining(messageTimeoutMs);
            msg.setBuckets(List.of(bucket.getSuperbucket(), bucket.getProgress()));
            msg.setDocumentSelection(params.getDocumentSelection());
            msg.setBucketSpace(params.getBucketSpace());
            msg.setFromTimestamp(params.getFromTimestamp());
            msg.setToTimestamp(params.getToTimestamp());
            msg.setMaxPendingReplyCount(params.getMaxPending());
            msg.setFieldSet(params.fieldSet());
            msg.setVisitInconsistentBuckets(params.visitInconsistentBuckets());
            msg.setVisitRemoves(params.visitRemoves());
            msg.setParameters(params.getLibraryParameters());
            msg.setRoute(params.getRoute());
            msg.setMaxBucketsPerVisitor(params.getMaxBucketsPerVisitor());
            msg.setPriority(params.getPriority()); // TODO: remove on Vespa 9

            msg.setRetryEnabled(false);

            return msg;
        }
Called from the constructor to ensure control and data handlers
are set and initialized.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java