Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 400 Bad Request when exporting registrations #119

Closed
yangchengs opened this issue Feb 1, 2022 · 1 comment · Fixed by #121
Closed

[BUG] 400 Bad Request when exporting registrations #119

yangchengs opened this issue Feb 1, 2022 · 1 comment · Fixed by #121

Comments

@yangchengs
Copy link

This is a cx reporting issue and I can reproduce the same thing. The notification hub is standard tier.
When I run the sample code, it gives me error:
Error: HTTP/1.1 400 Bad Request - 400The supplied notificationhub job payload is invalid.TrackingId:85871df2-dd9d-48d5-b435-b7539879f3d1_G14,TimeStamp:2/1/2022 1:44:36 AM

pom.xml

com.windowsazure Notification-Hubs-java-sdk 0.4.2

code:

import com.windowsazure.messaging.NotificationHub;
import com.windowsazure.messaging.NotificationHubJob;
import com.windowsazure.messaging.NotificationHubJobStatus;
import com.windowsazure.messaging.NotificationHubJobType;

public class NotificationHubTest {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	// Submit an export job
	NotificationHub hub = new NotificationHub("Endpoint=sb://myhubspace2.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=xpPzFQR9etp9/UEUi6trxUpP6IEBAixV67AnqkoI5Tc=", "myhub002");
	
	try
	
	{
		NotificationHubJob job = new NotificationHubJob();
		job.setJobType(NotificationHubJobType.ExportRegistrations);
		job.setOutputContainerUri("https://yangshendls12312.blob.core.windows.net/dir1?sv=2018-03-28&sr=c&sig=1VI51zRmC71DHo2%2Ft1SfRcXUAYde%2BloFd8Xow15Ozy8%3D&se=2022-02-01T04%3A41%3A05Z&sp=rwl");
		job = hub.submitNotificationHubJob(job);

		// Wait until the job is done
		while(true){
		    Thread.sleep(1000);
		    job = hub.getNotificationHubJob(job.getJobId());
		    if(job.getJobStatus() == NotificationHubJobStatus.Completed)
		        break;
		}
	}
	catch (Exception ex)
	{
		System.out.print(ex.getMessage());			
	}
}

}

@yangchengs
Copy link
Author

I tested version 1.0.0, and it gives me the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant