Symfony - switch from php-ampqlib RabbitMQ bundle to messenger - which is the way? - symfony

I am trying to change switch to symfony messenger, but documentation doesnt show me way.
Lets have old configuration for php-ampqlib:
mail_queue:
connection: message
exchange_options: { name: 'mail_queue', type: direct }
queue_options: { name: 'mail_queue',arguments: { 'x-dead-letter-exchange': [ 'S', 'mail_queue_failed' ],'x-dead-letter-routing-key': [ 'S', '' ],'x-max-priority': [ 'I',10 ] } }
callback: AppBundle\Consumer\MailQueueConsumer
qos_options: { prefetch_size: 0, prefetch_count: 1, global: false }
mail_queue_failed:
connection: message
exchange_options: { name: 'mail_queue_failed', type: direct }
queue_options: { name: 'mail_queue_failed', arguments: { 'x-message-ttl': [ 'I', 20000 ], 'x-dead-letter-exchange': [ 'S', 'mail_queue' ],'x-dead-letter-routing-key': [ 'S', '' ] } }
callback: AppBundle\Consumer\DoingNothingConsumer
How is the same configuration for Symfony messenger? I have spended a lot of hours without success.
Thank you very much.
D

Related

Firestore: REST API call to runQueries

URL:https://firestore.googleapis.com/v1/{parent=projects//databases//documents}:runQuery
Request body:
{ structuredQuery:
{ from: [
{ collectionId: 'questions'
}
],
orderBy: [
{ field:
{ fieldPath: 'created'
}, direction: 'DESCENDING' }
], select: { fields:
[
{ fieldPath: 'id' },
{ fieldPath: 'details' },
{ fieldPath: 'question' },
{ fieldPath: 'votes' }
]
},
where: {
compositeFilter: {
filters: [
{ fieldFilter: {
field: {
fieldPath: 'author'
},
op: 'EQUAL',
value: {
stringValue: "henry"
}
}
}
], op: 'AND'
}
},
limit: 4
}
}
What error do I get?
[{
"readTime": "2022-12-26T12:46:55.107240Z"
}]
the response isn't returning the expected results
What am I trying to do?
Fetch the given field from the collection: "questions" where the "author" matches "henry"
The documentation is available and it looks pretty straighforward.
Making REST calls
All REST API endpoints exist under the base URL https://firestore.googleapis.com/v1/.
To create a path to a document with the ID LA in the collection
cities under the project YOUR_PROJECT_ID you would use the
following structure.
/projects/YOUR_PROJECT_ID/databases/(default)/documents/cities/LA
To interact with this path, combine it with the base API URL.
https://firestore.googleapis.com/v1/projects/YOUR_PROJECT_ID/databases/(default)/documents/cities/LA
The best way to begin experimenting with the REST API is to use
the API Explorer, which automatically generates Google Identity OAuth
2.0 tokens and allows you to examine the API.

Nuxt basic auth does not work on Firebase

I am working on a Nuxt project which is deployed on firebase. I have basic auth configuration set up using nuxt-basic-auth-module.
It works locally, but on firebase does not work which I do not why. Am I doing something wrong? Additional settings required? Please give me advices. Thank you very much.
nuxt.config.js
import colors from 'vuetify/es5/util/colors'
require('dotenv').config()
export default {
mode: 'universal',
head: {
titleTemplate: '%s - ' + process.env.npm_package_name,
title: process.env.npm_package_name || '',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
loading: { color: '#fff' },
buildModules: [
'#nuxtjs/vuetify',
'#nuxtjs/dotenv'
],
modules: [
'#nuxtjs/axios',
'#nuxtjs/proxy',
'nuxt-basic-auth-module'
],
build: {
extend (config, ctx) {
}
},
server: {
port: 4000, // default: 3000
host: '0.0.0.0' // default: localhost
},
env: {
baseUrl: process.env.BASE_URL
},
basic: {
name: 'basicauthusername',
pass: 'basicauthpasswrd1234'
}
}
As mentioned on documentation, enabled comes with false value by default
basic: {
name: 'basicauthusername',
pass: 'basicauthpasswrd1234'
enabled: true // Add this property
}

how to extend faceted search by passing extra argument to the url in alfresco 5.1.1

We want to customize the faceted search by passing extra argument in the faceted search URL and read it in org\alfresco\slingshot\search\search.get.js---->search.lib.js.
http://localhost:8080/share/page/dp/ws/faceted-search#searchTerm=Koala.jpg&scope=repo&nodeRef=test
In searchDocLib json ,we have nodeRef value assigned it to selectedContainer but that argument is not coming in search.get.js. Basically how to pass extra argument in searchDocLib?How to enable logs for faceted-search.get.js so that logger statements should be printed in share.log?
var noderef = (page.url.args["nodeRef"] != null) ? page.url.args["nodeRef"] : "";
logger.log(page.url.templateArgs.nodeRef+"....nodeRef = "+nodeRef);
// Build the searchDocLib model
var searchDocLib = {
id: "FCTSRCH_SEARCH_RESULTS_LIST",
name: "alfresco/documentlibrary/AlfSearchList",
config: {
viewPreferenceProperty: "org.alfresco.share.searchList.viewRendererName",
view: viewRendererName,
waitForPageWidgets: true,
useHash: true,
useLocalStorageHashFallback: true,
hashVarsForUpdate: [
"searchTerm",
"facetFilters",
"sortField",
"sortAscending",
"query",
"scope",
"selectedContainer"
],
selectedScope: "repo",
useInfiniteScroll: true,
siteId: null,
rootNode: repoRootNode,
repo: false,
selectedContainer: noderef,
additionalControlsTarget: "FCTSRCH_RESULTS_MENU_BAR",
additionalViewControlVisibilityConfig: hideOnZeroResultsConfig,
widgets: [
{
id: "FCTSRCH_SEARCH_ADVICE_NO_RESULTS",
name: "alfresco/documentlibrary/views/AlfSearchListView",
config: {
widgetsForNoDataDisplay: widgetsForNoDataDisplay,
a11yCaption: msg.get("faceted-search.results.caption"),
a11yCaptionClass: "hiddenAccessible",
widgetsForHeader: [
{
id: "FCTSRCH_THUMBNAIL_HEADER_CELL",
name: "alfresco/documentlibrary/views/layouts/HeaderCell",
config: {
label: msg.get("faceted-search.results.heading.thumbnail"),
class: "hiddenAccessible",
a11yScope: "col"
}
},
{
id: "FCTSRCH_DETAILS_HEADER_CELL",
name: "alfresco/documentlibrary/views/layouts/HeaderCell",
config: {
label: msg.get("faceted-search.results.heading.details"),
class: "hiddenAccessible",
a11yScope: "col"
}
},
{
id: "FCTSRCH_ACTIONS_HEADER_CELL",
name: "alfresco/documentlibrary/views/layouts/HeaderCell",
config: {
label: msg.get("faceted-search.results.heading.actions"),
class: "hiddenAccessible",
a11yScope: "col"
}
}
],
widgets: [
{
id: "FCTSRCH_SEARCH_RESULT",
name: "alfresco/search/AlfSearchResult",
config: {
enableContextMenu: false
}
}
]
}
},
{
id: "FCTSRCH_GALLERY_VIEW",
name: "alfresco/documentlibrary/views/AlfGalleryView",
config: {
showNextLink: true,
nextLinkLabel: msg.get("faceted-search.show-more-results.label"),
widgetsForNoDataDisplay: widgetsForNoDataDisplay,
widgets: [
{
id: "FCTSRCH_GALLERY_VIEW_THUMBNAIL_DOC_OR_FOLDER",
name: "alfresco/search/SearchGalleryThumbnail",
config: {
widgetsForSelectBar: [
{
id: "FCTSRCH_GALLERY_VIEW_MORE_INFO_OR_FOLDER",
name: "alfresco/renderers/MoreInfo",
align: "right",
config: {
filterActions: true,
xhrRequired: true
}
}
],
publishTopic: "ALF_NAVIGATE_TO_PAGE",
renderFilter: [
{
property: "type",
values: ["document","folder"],
negate: false
}
]
}
},
{
id: "FCTSRCH_GALLERY_VIEW_THUMBNAIL_OTHER",
name: "alfresco/search/SearchGalleryThumbnail",
config: {
widgetsForSelectBar: [
{
id: "FCTSRCH_GALLERY_VIEW_MORE_INFO_OTHER",
name: "alfresco/renderers/MoreInfo",
align: "right",
config: {
filterActions: true,
allowedActionsString: "[\"document-delete\"]",
xhrRequired: true
}
}
],
publishTopic: "ALF_NAVIGATE_TO_PAGE",
renderFilter: [
{
property: "type",
values: ["document","folder"],
negate: true
}
]
}
}
]
}
},
{
id: "FCTSRCH_INFINITE_SCROLL",
name: "alfresco/documentlibrary/AlfDocumentListInfiniteScroll"
}
]
}
};
I've written a blog post that covers customizing the search page. Although it isn't exactly the same use case, the principle remains the same - you're going to want to create your own SearchService (extending the default one) and then swap yours for the default one in the faceted-search page model. You'll want to extend the onSearchRequest function to include the extra request parameter.

Alfresco Aikau - creating list for view

I have been working through the Aikau tutorials on Github but can't work out how to create a list that I can pass on to a view. The requirement is to select all workflow tasks for all users and display the results.
I have added the following widgets which displays the details of one users(hard coded), but I need to cycle through all the users and display all workflows.
model.jsonModel = {
services: [
"alfresco/services/CrudService"
],
widgets:[
{
name: "alfresco/lists/AlfSortablePaginatedList",
config: {
loadDataPublishTopic: "ALF_CRUD_GET_ALL",
loadDataPublishPayload: {
url: "api/task-instances?authority=abeecher"
},
itemsProperty: "data",
widgets: [
{
name: "alfresco/lists/views/AlfListView",
config: {
additionalCssClasses: "bordered",
widgetsForHeader: [
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Workflow ID",
sortable: true,
sortValue: "id"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Description"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Status"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Due Date",
sortable: true,
sortValue: "properties.bpm_dueDate"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Created By"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Assigned To",
sortable: true,
sortValue: "owner.firstName"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Tag1"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Tag2"
}
},
{
name: "alfresco/lists/views/layouts/HeaderCell",
config: {
label: "Tag3"
}
}
],
widgets: [
{
name: "alfresco/lists/views/layouts/Row",
config: {
widgets: [
{
name: "alfresco/lists/views/layouts/Cell",
config: {
additionalCssClasses: "mediumpad",
widgets: [
{
name: "alfresco/renderers/Property",
config: {
propertyToRender: "id",
}
}
]
}
},
{
name: "alfresco/lists/views/layouts/Cell",
config: {
widgets: [
{
name: "alfresco/renderers/Property",
config: {
propertyToRender: "workflowInstance.message",
}
}
]
}
},
{
name: "alfresco/lists/views/layouts/Cell",
config: {
widgets: [
{
name: "alfresco/renderers/Property",
config: {
propertyToRender: "state",
}
}
]
}
},
{
name: "alfresco/lists/views/layouts/Cell",
config: {
widgets: [
{
name: "alfresco/renderers/Property",
config: {
propertyToRender: "properties.bpm_dueDate",
}
}
]
}
},
{
name: "alfresco/lists/views/layouts/Cell",
config: {
widgets: [
{
name: "alfresco/renderers/Property",
config: {
propertyToRender: "workflowInstance.initiator.firstName" ,
}
}
]
}
},
{
name: "alfresco/lists/views/layouts/Cell",
config: {
widgets: [
{
name: "alfresco/renderers/Property",
config: {
propertyToRender: "owner.firstName",
}
}
]
}
},
]
}
}
]
}
}
]
}
}
]
};
The final solution will require the ability to sort the columns and be able to click on a task to see the underlying workflow. What would be the best way to create the initial list based on these requirements?
If I was to write a widget that did the building of the list, how do I couple the widget to the form? Is this a pub/sub solution since the user is not clicking on anything - just loading the page?
I assume that I would need to write custom a webscript if I use the "url" keyword under the loadDataPublishPayload option? If I did write a webscript, what would be the final statement to return the json data to the form?
I just need some guidance on the best way forward.
At the time of writing, using the latest released version of Aikau (1.0.83) it is not possible to do this using out-of-the-box widgets and services.
The main problem is that there is no full mapping between Aikau and the Share XML based forms runtime. This blog post explains the issue at hand. It is however something that we're working on.
Once the "alfresco/services/FormsRuntimeService" is complete this will be an easier exercise to complete. There would be no need to write additional widgets for the lists because the existing list widgets handle all the requirements for sorting/pagination (if the underlying REST API supports sorting and pagination!).
I guess your best way forward is very dependent upon how quickly require this solution. We're making progress with the FormsRuntimeService, but I can't say when it will be fully ready.
The existing pages in Share that show tasks and workflow that do use the Share Forms Runtime rely on APIs that return HTML that is hard-coded to work with the Share YUI2 based widgets - it might be possible to achieve what you want to using the older Surf Component / YUI2 widget approach. That might be one other area to explore.
The main thing to do is to establish whether or not there are existing REST APIs that will meet you core requirements

PartialShardFailureException when trying to filter by GeoDistance (foselasticaBundle Symfony2)

For a few days my elastica query doesn't work anymore. I don't have problem to populate and if i remove the GeoDistance part the request is been executed and i get results. Currently, in the trace, I got the following message:
"message": "1",
"class": "Elastica\\Exception\\PartialShardFailureException",
"trace": [
{
"namespace": "",
"short_class": "",
"class": "",
"type": "",
"function": "",
"file": "/Applications/MAMP/htdocs/GTAB/what2days/api/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php",
"line": 150,
"args": []
}
It means nothing to me so I just made a var_export of $shardsStatistics variable and I get that:
array (
'total' => 6,
'successful' => 5,
'failed' => 1,
'failures' =>
array (
0 =>
array (
'index' => '.marvel-2014.09.16',
'shard' => 0,
'status' => 400,
'reason' => 'SearchParseException[[.marvel-2014.09.16][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"query":{"bool":{"must":[{"term":{"online":{"value":1}}}]}},"filter":{"bool":{"must":[{"geo_distance":{"distance":"100mi","location.latlon":{"lat":48.891773,"lon":2.3379156}}}]}}}}}},"size":"100"}]]]; nested: QueryParsingException[[.marvel-2014.09.16] failed to find geo_point field [location.latlon]]; ',
),
),
)
The error finish by " failed to find geo_point field [location.latlon]] ". I don't know why it doesn't work because when i check the _mapping the geo_point exists and i didn't make a mistake with the name of the property.
location: {
properties: {
latitude: {
type: "float",
store: true
},
latlon: {
type: "geo_point",
store: true,
lat_lon: true
},
longitude: {
type: "float",
store: true
}
}
},
And this is the way i set fos_elastica
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
search:
finder: ~
types:
mytype:
mappings:
title:
type: string
online:
type: integer
information: ~
location:
type: object
properties:
longitude:
type: float
latlon:
type: geo_point
lat_lon: true
boost: 10
persistence:
driver: orm
model: API\Rest\v1\MyBundle\Entity\MyEntity
provider: ~
listener: ~
finder: ~
repository: API\Rest\v1\MyBundle\Repository\MyRepository
When i make a kopf request with the query value (see following query) retrieved by $query->getQuery() i get a correct result.
{
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"term": {
"online": {
"value": 1
}
}
}
]
}
},
"filter": {
"bool": {
"must": [
{
"geo_distance": {
"distance": "1mi",
"location.latlon": {
"lat": 48.891773,
"lon": 2.3379156
}
}
}
]
}
}
}
}
}
I don't know what to do. I was on 3.0.*#alpha version and now I'm trying the dev-master. I hope someone will help me find what goes wrong.
When I make a var_export in the method getData from Elastica/Response.php I have the failure I explained earlier and I also have 1 hit (the one Iwant to get).
I finally found the solution.
I had to add an index_name and tell \Elastica\Search to addIndex('new_index') and addType('specific type')
I thought the search will automatically get the correct index because I was using a specific repository but I was wrong.

Resources