You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Where do we set the user agent in the request? #278
Adding the version would be nice and as we already include it in the jar's manifest that would not be hard. We should probably have this logic for getting the "application name" in the core module
as a utility or as part of the ServiceOptions.
Note, setting it for the datastore would be a little tricky as we don't use the apiary client directly but rather use the datastore-protobufclient which does not seem to expose it. /cc @pcostell
Is it possible to set a header in datastore calls?
A separate question, do you have access to the headers of the incoming HTTP requests?
For example, a user makes a HTTP request, say ListMyContacts, to the app and then the app makes a bunch of datastore call to handle the HTTP request. I am interested in extracting headers from this user issued HTTP request.
I think we will be able to set it also in the Datastore calls, but I cc @pcostell for some advice (so we will do it the right way).
The app which uses gcloud-java could be a stand-alone, servlet, or anything else. The app does not pass any context information to the gcloud-java api and therefore we are not aware if a call is triggered by some HTTP request or have any information about it.
It looks like you could do this either by continuing to use the Datastore clients and override RemoteRpc.java (which then gets passed in when you create a Datastore), or you could just stop using the client (may be better long term since you replicate a lot of the work anyways for the other APIs).
I don't think we can override RemoteRpc.java as it is package protected.
Right, we could avoid using the Datastore protobuf client and instead use the apiary client directly but I wonder if it is worth the effort considering the future migration to gRPC. Also, do you have this client available for v1beta3?
Looking at what we use within the Datastore client, I think we could decouple gcloud-java from the Datastore client without too much effort now and then maintain it without too much additional work. It looks like we would only need to replace the functionality of the client's RemoteRpc.java, DatastoreFactory.java, Datastore.java, and DatastoreOptions.java. Most of the work in the client's DatastoreHelper.java is done by our gcloud-java-core module.
I spent some time trying to use the apiary client, and that necessitated a lot of superficial changes that would be more trouble than its worth, especially when merging in the v1beta3 branch. I can look into using gRPC after the v1beta3 branch is merged in and we're ready to migrate to gRPC.
Activity
aozarov commentedon Oct 22, 2015
It is now hard-coded as "gcloud-java".
Adding the version would be nice and as we already include it in the jar's manifest that would not be hard. We should probably have this logic for getting the "application name" in the
coremoduleas a utility or as part of the
ServiceOptions.Note, setting it for the datastore would be a little tricky as we don't use the apiary client directly but rather use the
datastore-protobufclient which does not seem to expose it. /cc @pcostellcircy9 commentedon Oct 22, 2015
Is it possible to set a header in datastore calls?
A separate question, do you have access to the headers of the incoming HTTP requests?
For example, a user makes a HTTP request, say ListMyContacts, to the app and then the app makes a bunch of datastore call to handle the HTTP request. I am interested in extracting headers from this user issued HTTP request.
aozarov commentedon Oct 22, 2015
I think we will be able to set it also in the Datastore calls, but I cc @pcostell for some advice (so we will do it the right way).
The app which uses
gcloud-javacould be a stand-alone, servlet, or anything else. The app does not pass any context information to the gcloud-java api and therefore we are not aware if a call is triggered by some HTTP request or have any information about it.aozarov commentedon Oct 23, 2015
@mziccard Do you want to take care of this? Ajay has already few outstanding issues to take care of.
pcostell commentedon Oct 26, 2015
It looks like you could do this either by continuing to use the Datastore clients and override RemoteRpc.java (which then gets passed in when you create a Datastore), or you could just stop using the client (may be better long term since you replicate a lot of the work anyways for the other APIs).
aozarov commentedon Oct 26, 2015
I don't think we can override RemoteRpc.java as it is package protected.
Right, we could avoid using the Datastore protobuf client and instead use the apiary client directly but I wonder if it is worth the effort considering the future migration to gRPC. Also, do you have this client available for v1beta3?
/cc @ajkannan
pcostell commentedon Oct 26, 2015
Ah good point -- we could probably add some extra handling to push headers onto the call.
If you are planning a grpc migration soon you could do that too -- v1beta3 does work with grpc.
We have a v1beta3 implementation but it hasn't made it onto github yet. If you ping me privately I can send you a link.
ajkannan commentedon Oct 26, 2015
Looking at what we use within the Datastore client, I think we could decouple gcloud-java from the Datastore client without too much effort now and then maintain it without too much additional work. It looks like we would only need to replace the functionality of the client's
RemoteRpc.java,DatastoreFactory.java,Datastore.java, andDatastoreOptions.java. Most of the work in the client'sDatastoreHelper.javais done by ourgcloud-java-coremodule.ajkannan commentedon Oct 27, 2015
I spent some time trying to use the apiary client, and that necessitated a lot of superficial changes that would be more trouble than its worth, especially when merging in the v1beta3 branch. I can look into using gRPC after the v1beta3 branch is merged in and we're ready to migrate to gRPC.
aozarov commentedon Oct 29, 2015
I think we should consider #307 as a fix for this issue. I opened a separate issue, #308, for just Datastore.
14 remaining items
chore(main): release 1.1.5 (#285)
chore(main): release 1.2.5 (#289)
chore(main): release 1.0.5 (#300)
chore(main): release 1.2.8 (#298)
chore(deps): update dependency com.google.cloud:google-cloud-gsuite-a…
chore(main): release 2.0.0 (#739)
deps: update dependency com.google.cloud:google-cloud-logging to v2.1…
chore: release 0.119.3 (#280)
chore: release 1.105.3 (#278)
Update instructions for google-auth-library-appengine artifact (#278)
Update instructions for google-auth-library-appengine artifact (#278)
deps: do not re-declare grpc dependencies as test dependencies (googl…
chore: add product documentation link (#278)
chore: add product documentation link (#278)
deps: update autovalue.version to v1.7.1 (googleapis#278)