Skip to content

Bulk operation is not working  #69

@mjaiswal17

Description

@mjaiswal17

` private void bulkCreateItems(List messages) {

    CosmosItemResponse cosmosItemResponse = container.createItem(messages.get(0));

    List<CosmosItemOperation> cosmosItemOperations = new ArrayList<>();
    for (Message message : messages) {
        cosmosItemOperations.add(CosmosBulkOperations.getCreateItemOperation(message, new PartitionKey(message.getEngagementId())));
    }

    
    Iterable<CosmosBulkOperationResponse<Message>> iterable = container.executeBulkOperations(cosmosItemOperations);
    
    }
    `
    
    Note:  CosmosItemResponse cosmosItemResponse = container.createItem(messages.get(0)); 
    is working and able to create the item in cosmos. Which means the container object is fine and working. It fails on the execute bulk operation part.
    
    

    Error:
    
    16:50:39.104 [bulk-executor-bounded-elastic-9] ERROR com.azure.cosmos.implementation.batch.BulkExecutor -- HandleTransactionalBatchOperationResult - Fail, PKRange 0, Response Status Code 200, Operation Status Code -1, ItemOperation[Type: CREATE, PK: ["c8ad54fb-043d-4749-911c-2846bbd8c081"], id: null], Context: BulkExecutor-1[n/a] Thread[Name: bulk-executor-bounded-elastic-9,Group: main, isDaemon: true, Id: 58]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions