modules/andes-core/broker/src/main/java/org/wso2/andes/store/rdbms/RDBMSMessageStoreImpl.java
void addMetadataToBatch(PreparedStatement preparedStatement, AndesMessageMetadata metadata,
            final String queueName) throws AndesException {

        Context metaAdditionToBatchContext = MetricManager.timer(MetricsConstants.ADD_META_DATA_TO_BATCH, Level.INFO)
                .start();
        Context contextWrite = MetricManager.timer(MetricsConstants.DB_WRITE, Level.INFO).start();
        try {
            preparedStatement.setLong(1, metadata.getMessageID());
            preparedStatement.setInt(2, getCachedQueueID(queueName));
            preparedStatement.setBytes(3, metadata.getMetadata());
            preparedStatement.addBatch();
        } catch (SQLException e) {
            throw rdbmsStoreUtils.convertSQLException(
                    "error occurred while adding metadata with messaged id: " + metadata.getMessageID() + " to batch",
                    e);
        } finally {
            metaAdditionToBatchContext.stop();
            contextWrite.stop();
        }
    }
/**
     * Adds a single metadata to a batch insert of metadata.
     *
     * @param preparedStatement prepared statement to add messages to metadata table
     * @param metadata          AndesMessageMetadata
     * @param queueName         queue to be assigned
     * @throws SQLException
     */
Adds a single metadata to a batch insert of metadata.
@param preparedStatement prepared statement to add messages to metadata table
@param metadata          AndesMessageMetadata
@param queueName         queue to be assigned
@throws SQLException
Adds a single metadata to a batch insert of metadata . @param preparedStatement prepared statement to add messages to metadata table @param metadata AndesMessageMetadata @param queueName queue to be assigned @throws SQLException
void addMetadataToBatch(PreparedStatement preparedStatement, AndesMessageMetadata metadata,
            final String queueName) throws AndesException {
        Context metaAdditionToBatchContext = MetricManager.timer(MetricsConstants.ADD_META_DATA_TO_BATCH, Level.INFO)
                .start();
        Context contextWrite = MetricManager.timer(MetricsConstants.DB_WRITE, Level.INFO).start();
        try {
            preparedStatement.setLong(1, metadata.getMessageID());
            preparedStatement.setInt(2, getCachedQueueID(queueName));
            preparedStatement.setBytes(3, metadata.getMetadata());
            preparedStatement.addBatch();
        } catch (SQLException e) {
            throw rdbmsStoreUtils.convertSQLException(
                    "error occurred while adding metadata with messaged id: " + metadata.getMessageID() + " to batch",
                    e);
        } finally {
            metaAdditionToBatchContext.stop();
            contextWrite.stop();
        }
    }
void addMetadataToBatch ( PreparedStatement preparedStatement , AndesMessageMetadata metadata , final String queueName ) throws AndesException { Context metaAdditionToBatchContext = MetricManager . timer ( MetricsConstants . ADD_META_DATA_TO_BATCH , Level . INFO ) . start ( ) ; Context contextWrite = MetricManager . timer ( MetricsConstants . DB_WRITE , Level . INFO ) . start ( ) ; try { preparedStatement . setLong ( 1 , metadata . getMessageID ( ) ) ; preparedStatement . setInt ( 2 , getCachedQueueID ( queueName ) ) ; preparedStatement . setBytes ( 3 , metadata . getMetadata ( ) ) ; preparedStatement . addBatch ( ) ; } catch ( SQLException e ) { throw rdbmsStoreUtils . convertSQLException ( "error occurred while adding metadata with messaged id: " + metadata . getMessageID ( ) + " to batch" , e ) ; } finally { metaAdditionToBatchContext . stop ( ) ; contextWrite . stop ( ) ; } }
Adds a single metadata to a batch insert of metadata.
Adds a single metadata to a batch insert of metadata .